Re: What is an "anonymous temporary file?" (question about PerlFAQ5)



[A complimentary Cc of this posting was sent to
A. Sinan Unur
<1usa@xxxxxxxxxxxxxxxxxxx>], who wrote in article <Xns96839E48598CBasu1cornelledu@xxxxxxxxx>:
> > Or, is this an actual file on an actual filesystem? (ie, something
> > you could test with -f if you knew the name?)
>
> It is on the actual file system

Correct...

> but it does not have a name (hence, 'anonymous').

Correct only in a few situations (OSes and filesystems). Background:
some filesystems allow opened files to be unlink()ed from their
directory entry; the only way to access the file is through
filedescriptors already opened to these files. If possible, Perl will
use this mechanism.

If not supported, some more complicated scheme (with obscurely named
files in suitable directories, possibly locked so that nobody else can
access it, and possibly some atexit() magic) is used.

Hope this helps,
Ilya
.