in reply to Out of a hole?

The solution I can think of is to recursively open the "." and ".." directories, looking for the entries with the same inode and building the path that way.

But that seems to be what the Cwd module does. And Cwd is a standard module, so you don't need to install anything extra (if that's what you want to avoid) and you don't have to reinvent the wheel.

If you absolutely do not want to use modules (even standard ones) for whatever reason, I would also suggest what nardo said: look at Cwd.pm, extract the appropriate functionality and put it in your code.

--ZZamboni

Replies are listed 'Best First'.
RE: Re: Out of a hole?
by Intrepid (Curate) on Jul 06, 2000 at 22:15 UTC
    <SCRIPT LANGUAGE="JavaScript"> </SCRIPT> <NOSCRIPT> </NOSCRIPT>
    The solution I can think of is to recursively open the "." and ".."
    directories, looking for the entries with the same inode and
    building the path that way. But that seems to be what the Cwd
    module does. And Cwd is a standard module, so you don't need to
    install anything extra (if that's what you want to avoid) and you
    don't have to reinvent the wheel. If you absolutely do not want to
    use modules (even standard ones) for whatever reason, I would also
    suggest what nardo said: look at Cwd.pm, extract the appropriate
    functionality and put it in your code.

    Thanks ZZamboni. That's sound advice. It is probably what i shall do, while at the same time, for anybody losing sleep over this (LOL) something came to my attention (that frayed, intermittently failing attention ...) about the context of my perceived need to find out about this: i probably won't have to do this after all.

    The free Web serving at Tripod was the reason for this. I've wanted to take advantage of the 50 free MB i have there and i needed to make a script do some stuff .. kinda cool Perl stuff (when it works -- it already does elsewhere but not on Tripod, so it's not as bulletproof as I want it to be -- it will be posted for the Brothers to look over). Anyway, on Tripod, the user cgi server always sets the user cgi-bin dir as "root" and doesn't know of anything else in the Universe above that. That simplifies things meaning I know what `/'points to, now.

    Anyway, good advice as I said, and i'll take a look at Cwd.pm when i decide its time to tackle this.