Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^4: Tie::Filesystem - request for review

by erikharrison (Deacon)
on Jun 23, 2004 at 07:06 UTC ( #368958=note: print w/ replies, xml ) Need Help??

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?


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

Comment on Re^4: Tie::Filesystem - request for review
Replies are listed 'Best First'.
Re^5: Tie::Filesystem - request for review
by jepri (Parson) on Jun 24, 2004 at 00:56 UTC
    I'm not quite sure of the what you are suggesting there, but it does sound good. Having a unique key for each file is nice, but I'm tempted to suggest that I can build that very easily as I do my hash traversal. In use, I'm likely to get the hashref for the directory, and then iterate over the files or something like that.

    The obvious solution would be an object, but I'm not found of objects in this sort of work. They aren't particularily perlish. I'm not exactly sure what would be though.

    I look forwards to your publishing your code - I have a use for it so I can guarantee you a user right away.

    I didn't believe in evil until I dated it.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2015-11-25 17:29 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (683 votes), past polls