Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
Nash

Chapter 11 - Navigating Directories

Recommended Posts

Hi i was wondering if someone could help me understand why in the chapter "navigating directories" the substr function is there. If i take it away then . and .. appears on top of the folders. I read in the book that "That same conditional also checks that the current item isn’t the current directory (marked by a single period on Unix systems) or the parent directory (marked by a double period on Unix

systems". But from what i can tell is that the path would be something like this -> /.folder_name . Does the period before a folder show that it is in the same directory because i thought it would go something like this -> ./folder_name.

 

Thanks in advance

Nash

Share this post


Link to post
Share on other sites

That returns the first character in $item: a substring starting at position 0 (i.e., the first character) and going a length of 1 characters.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...