Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

RE: /bin/pwd (Re: Taint checking)

by ncw (Friar)
on Sep 25, 2000 at 22:12 UTC ( [id://33940]=note: print w/replies, xml ) Need Help??

in reply to /bin/pwd (Re: Taint checking)
in thread Taint checking, File::Find and Cwd

I always thought of this tracking of your current directory to be shell magic just for the convenience of the user, eg an example (run on linux)

$ cd /usr/X11
$ pwd
$ /bin/pwd
$ ls -ld /usr/X11
lrwxrwxrwx   1 root     root            5 Oct 21  1999 /usr/X11 -> X11R6
But I see what you are saying in the case of the current directory being a deleted directory, eg :-
$ mkdir test
cd test
pwd ; /bin/pwd
rmdir .
$ pwd ; /bin/pwd
/bin/pwd: cannot get current directory: No such file or directory
Anyway, getcwd() was what I expected Cwd to use, and I was very suprised to see this /bin/pwd thing!

Thanks for the explanation. I think from the above experinents /bin/pwd == getcwd() under linux, so on that platform at least it should be replaced with getcwd(). According to my man pages getcwd() is POSIX so pretty much any unix should support it now-a-days.

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (1)
As of 2024-05-27 07:45 GMT
Find Nodes?
    Voting Booth?

    No recent polls found