In a cpp application I am deleting a file on a partition, but space is not freeing..
1) deleting file using remove() call
2) no other hard link for the file 3) tried to close file descriptor using following scripts then remove() call ------- for fd in $(ls /proc/$$/fd); do case "$fd" in 0|1|2|255) ;; *) eval "exec $fd>&-" ;; esac done ------- But space not freed 4) I tried with truncate() and then remove() call Now files deleted and space freed Is it the only and right way to do this? |
From the man page for remove:
Quote:
|
I think your for cycle does not work, it is simple not possible (to close a file descriptor from outside, from another process - for example from a shell script).
|
Quote:
|
All times are GMT -5. The time now is 07:09 PM. |