I was just doing some research for a project and came across SetFileValidData() on Windows, which can be used to nearly instantly allocate a huge file containing whatever happened to be on the file system's free space. Just out of curiosity, I was wondering if there's a function like that on Linux/Unix.
Just out of curiosity, I was wondering if there's a function like that on Linux/Unix.
I hope not since it seems like a huge security risk.
You can allocate space to a file simply by seeking to whereever you want writing from there, but I think you'll find that the space is set to zeros or random data.