http://qs321.pair.com?node_id=368958


in reply to Re^3: Tie::Filesystem - request for review
in thread Tie::Filesystem - request for review

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