Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re3: Storing metadata with file handles

by blakem (Monsignor)
on Oct 04, 2002 at 19:02 UTC ( #202854=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Storing metadata with file handles
in thread Storing metadata with file handles

And if you want to get really evil (read nonportable, and somewhat unreliable) you can sometimes associate the filenum back to a filename. Warning: this code is fragile, won't always work, and will only work on unix.

my $fileno = fileno($fh); my $filename = readlink("/dev/fd/" . $fileno);
See: Re: Re: Can you delete a file by descriptor?

-Blake


Comment on Re3: Storing metadata with file handles
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://202854]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2014-10-02 05:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (49 votes), past polls