Quote:
Originally Posted by
Corona688
If you've deleted the file, then you have to kill whatever process has it open to close and remove it from disk.
If you hadn't deleted the file, you could've simply truncated it -- overwritten it with an empty file -- to reduce its size to zero.
Not necessarily.
It would depend on how the file is being written to by the process(es) that are writing to the file, and the file system in use.
If the file is being written to in append mode, truncating the file out from under the process(es) will probably work to reduce its size permanently.
If it's not being written to in append mode, after you truncate it down from, say, 10 GB to zero, the next time the process(es) write to the file, they'll still do so at the old 10 GB file offset. What happens then depends on whether or not the underlying file system supports sparse files.
And that's just if you're doing it all on a single machine. If it's a shared file (NFS, some other shared file system), things can get really fun.