httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Wichitill <>
Subject Re: [apreq-2] $upload->tempname on Win32
Date Mon, 05 Jul 2004 18:52:25 GMT
> I just looked over apr's Unix implementation of APR_DELONCLOSE,
> and it simply registers a pool cleanup handler that unlinks the
> file.  Only Win32's open() actually supports this on the OS-level.

Maybe APR doesn't use the Unix filesystem behaviour for the compatibility
reasons I mentioned, but on a normal ext3 filesystem, when I rm a file, the
actual file will only be gone after any open handles are closed. To test,
run this in one shell (create a small file called "data" in the same dir)

open my $fh, "data";
while (1) {
  seek($fh, 0, 0);
  print <$fh>;
  sleep 2;

and in another shell, rm the file while the script runs. ls won't show the
file anymore, but the script will continue to work. "lsof | grep perl" will
list the file as "/tmp/data (deleted)". This is also one of the reasons why
you can overwrite binaries while they're running on Unix.

View raw message