Now works with file streams. Has some problems with spaces