Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^4: Tie::Filesystem - request for reviewby erikharrison (Deacon) |
on Jun 23, 2004 at 07:06 UTC ( [id://368958]=note: print w/replies, xml ) | Need Help?? |
Actually, building a simple perl VFS on top of this was a plan from the begining
The reason that, say, $fs{etc}->{passwd} == '/etc/passwd' currently is because the downside of this interfece is that it is difficult to get the full pathname without walking back up the tree. Having the full path name gives the programmer flexibilty and keeps the thing light. What about this: an optional argument to the tie is a closure. This closure takes the full path to a file, and returns some arbitrary scalar - a filehandle ref, the leafname, a Tie::File array ref, whatever. How's that sound?
Cheers, Erik Light a man a fire, he's warm for a day. Catch a man on fire, and he's warm for the rest of his life. - Terry Pratchet
In Section
Seekers of Perl Wisdom
|
|