Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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?

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

  • 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.

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://368958]
help
Chatterbox?
[LanX]: communication overhead calls for sensible management
[ambrus]: "different specialized employees in different rooms" => so, there's a cleaner guy who cleans up the vomit from the bathroom every morning?
[erix]: makes me think of MMM too (mythical man month): "adding more people to a project makes it slower"
[erix]: that should be "to an already-too-late- project" I think
[ambrus]: oh yes, we have a pretty good example of that when they reorganized the grill place in the restaurant nearby.
[ambrus]: it now has two more people working there, and they're serving slower and more expensive.
[ambrus]: It used to be just a master cook who takes the order and puts the meat and eggs on the open grill plate table, and an assistant who removes them to a plate, adds the side dish, and gives the plate to the people in the queue, plus a cashier.
[ambrus]: Now it has five people instead of three, some sort of call number ticket system where people wait a lot for their food to get ready (it's the same kinds of grilled meat and fish on the same equipment, it won't actually fry slower),
[ambrus]: it's slow as hell, and the food costs significantly more.
[ambrus]: We no longer eat there.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (13)
As of 2017-09-22 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (264 votes). Check out past polls.

    Notices?