Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!unicorn!ogicse!hakanson From: hakanson@ogicse.ogi.edu (Marion Hakanson) Newsgroups: comp.lang.perl Subject: Re: How to find working directory? Message-ID: <11208@ogicse.ogi.edu> Date: 8 Aug 90 22:52:32 GMT References: <139945@sun.Eng.Sun.COM> <8974@jpl-devvax.JPL.NASA.GOV> Organization: Oregon Graduate Institute (formerly OGC), Beaverton, OR Lines: 24 In article <8974@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes: >In article <139945@sun.Eng.Sun.COM> petolino@joe.Eng.Sun.COM (Joe Petolino) writes: >: I know I can change my working directory with chdir(). Is there a >: symmetrical operation which tells me what my working directory is (short >: of invoking pwd in a subshell, that is)? > >No. This has bugged me for a long time. You've got rmdir and mkdir, which are implemented by running the corresponding commands, on systems which don't have rmdir(2) and mkdir(2). Why not provide the same kind of uniform access to getwd? Use the system call if it's there, and run "pwd" for the user if it's not. After all, isn't one of the points of Perl's existence to provide a uniform interface to various systems? Suppose I want to port my Perl script to a machine that doesn't have a pwd command (like DOS or some such)? I've asked for this before. I've also asked for a gethostname interface to the various "uname/hostname/gethostname" system calls, too. And ctime(3) and getfsent(3), etc. You can't always get what you want.... -- Marion Hakanson Domain: hakanson@cse.ogi.edu UUCP : {hp-pcd,tektronix}!ogicse!hakanson