> How can you tell if a file is in the process of being written to.
> Specifically, how can you tell if a file is in the middle of an
> FTP transfer without spending a lot of time querying the unix
> stat struct. Our processing that surrounds this issue is time
> critical. Any ideas would be appreciated.
and only move it to its permanent name after the transfer is complete.
This may or may not meet your "time critical" requirements, but it
avoids the race conditions and system load of relying on stat(2).
"The first cup of coffee recapitulates phylogeny." -- Ted Sturgeon, allegedly