I know how in Windows to create a file with an exact size x
Using the Win32 API, CreateFile, SetFilePointerEx, SetEndOfFile, and CloseHandle in that same order but how could I do something similar in Linux to a NTFS partition (ntfs-3g driver) without having to write all zeros to the file. I see falloc.h but does this only work for ext filesystems.. not ntfs? any tricks that don't require writing all zeros first?
another trick maybe see if there is adequate space on the disk for the file before writing so the data array of size t can be guaranteed to fit?
free to use asm, c, c++... just looking for ideas.
Thanks,
John



LinkBack URL
About LinkBacks



