Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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
/usr/X11
$ /bin/pwd
/usr/X11R6
$ 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
/home/ncw/test
/home/ncw/test
rmdir .
$ pwd ; /bin/pwd
/home/ncw/test
/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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-28 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found