in reply to Need Advice on Folder/Drive locking
Not sure if windows supports sparse files but I did the same task in unix by making a *SPARSE* lock file that was the same size as the file I was copying and used that in my size calculations.
sysopen( $fh, $lock_filename, O_RDWR | O_CREAT ); seek($fh, $filesize,0); truncate($fh,$filesize);
Then a stat call gives us the sparse size while the filesystem hasn't grown at all. To get a rough idea of free space you can tally the free space the FS reports minus the sum of the size of all your sparse lock files.
Update: Code typos fixed
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need Advice on Folder/Drive locking
by Marshall (Canon) on Feb 05, 2010 at 08:49 UTC |