On a unix/linux file system you see the following:

$ ls -la
total 244
drwx------    9 rcoops   ddao2        4096 Feb 13 09:40 .
drwxr-xr-x   39 root     root         4096 Feb 11 13:23 ..
-rw-------    1 rcoops   ddao2      158310 Feb 13 09:40 .bash_history
-rw-r--r--    1 rcoops   ddao2          24 Apr 25  2006 .bash_logout
-rw-r--r--    1 rcoops   ddao2        1228 Sep 12 12:08 .bash_profile
-rw-r--r--    1 rcoops   ddao2         169 Nov 20 17:12 .bashrc

On a windows file system you will see:

H:\>dir
 Volume in drive H is rcoops$
 Volume Serial Number is 2B01-1BEE
 Directory of H:\
02/05/2008  04:38 PM    <DIR>          Desktop
01/30/2008  01:49 PM    <DIR>          My Documents
02/08/2008  10:28 AM    <DIR>          WINDOWS
12/04/2006  05:32 PM    <DIR>          Program Files

On both file systems (on the command line) if you want to go one directory
up you type: cd .. so the ../file.txt means from the current working
directory (usually where your perl script is started from) go one directory
up and access file.txt

As for the ./file.txt this means as much as: in the current directory a file
called file.txt if this is not found an error is thrown.

If you type just file.txt your OS will look in the working directory and
then look in the directories specified in the PATH environment variable.

So it does nothing more then indicate to your OS which directory it needs to
look. (I am sure there is a far more extensive and more precise way of
explaining this but this is the simplest to understand and correct for most
intents and purposes)

I hope this helps a little bit.

Rob


On Feb 13, 2008 5:34 PM, <[EMAIL PROTECTED]> wrote:

> I've been going over some listings and I found code
>
> like the following:
>
>
>
> "./directory/file.txt" and
>
> "../directory/file.txt"
>
>
>
> but I've never seen the "./" and "../" things at the
>
> beginning of the path. I've tried to google these
>
> but had no luck. I've googled "file specification" and
>
> "directory specification" and got a lot of hits on stuff
>
> but nothing on what those symbols mean. So, I thought
>
> I'd ask here....so if you wouldn't mind explaining what
>
> they are to a newbie I'd appreciate it very much. Thank
>
> you.
>
>
>
>
> Portions of this message may be confidential under an exemption to Ohio's
> public records law or under a legal privilege. If you have received this
> message in error or due to an unauthorized transmission or interception,
> please delete all copies from your system without disclosing, copying, or
> transmitting this message.
>

Reply via email to