Home  |  Linux  | Mysql  | PHP  | XML
From:Rene Schickbauer Date:Mon Mar 22 16:27:16 2010
Subject:Re: 2 off in array count and index
jbl wrote:
> I am reading a directory and creating an array of .png file names. I
> know for a fact that there are 1025 png files in the folder
> With $count = @files I get 1027
> With $last = $#files I get 1026
> $files [0] = .
> $files[1] = ..

"." is the current directory, ".." is the parent directory.

These are always inserted by the filesystem in any directory for
navigation purposes. These are (in principle) dynamically generated
abbreviations for directory names.

Simply put
.. is needed when you need to go up one level higher in the file
hierachie without parsing the current path, like "cd .."

. is mostly needed on the command line, when you want to execute a
program from the current directory if its not in the search path, like
"./myapp".

You might want to take a look at
<http://www.washington.edu/computing/unix/startdoc/directories.html>

LG
Rene
Navigate in group perl.beginners.cgi at sever nntp.perl.org
Previous Next


Your recent visits
Re: Need help to resove..... ExtUtils-Makemaker comilationS
Re: cgi and perl database interaction
Re: 2 off in array count and index
Re: cgi and php database interaction
Re: cgi and perl database interaction



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants