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

Re: How do I change directory to root directory

by Taulmarill (Deacon)
on Mar 04, 2005 at 16:53 UTC ( [id://436645]=note: print w/replies, xml ) Need Help??


in reply to How do I change directory to root directory

you can access a file withour changing the directory. just provide the full path to open. $ENV{HOME} should contain your homedir on linux/unix platforms.
  • Comment on Re: How do I change directory to root directory

Replies are listed 'Best First'.
Re^2: How do I change directory to root directory
by kdelph (Initiate) on Mar 04, 2005 at 17:40 UTC
    So if I type in my $file ="home/test/sever/default/test.log.2005.03.04";
    That should work ? I don't need to change to the Test directory from home ?
      Correct. As long as the directory you run the script from has home as a directory underneath it.

      As a side note, use full paths unless there is a very good reason not to. It makes your life much easier.

        It does not work I tried it and keep getting a message
        No such file or directory Maybe I have my syntax wrong?:

        my $file ="/opt/directoryname/directoryname/directoryname/sever/default/log/log.2005.03.04";
        But my directory that I'm in does not have Home underneath it, it has nothing underneath it. That's my problem I'm trying to access a directory but am unable to do cd to go back to the root directory and then open the file.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-25 14:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found