Some file I/O functions, started on lzma streams, file generation for testing