Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The single dot represents the current working directory. The double dot represents the current working directory's parent directory.</p> <p>Neither of these represent a concrete 'file' in the underlying file system, but represent the directory's location within the file system hierarchy. Although you don't mention it, the '/' symbol, on its own, is similar to these in that it generally represents the root of a particular file system. ie</p> <pre><code>cd / </code></pre> <p>will take you to the root of the current file system.</p> <p>Rather, the '.' and '..' are references to available resources within the file system, and as such are pseudo-files or pseudo-references generated by the request for file information to the underlying file system and are included to aid navigation around the file system. They are generally OS independent ie. most OS systems respect their use.</p> <p>You say you are 'writing a program'. Many file management routines that retrieve directory listings include a switch or a method which ignores these pseudo-files when generating directory listings. </p> <p>However, its normally easiest to write your program to iterate over the entries and ignore these directory entries if you don't need them. Alternatively write your program to only list files, or even files of the specific type you are looking for. For example, use DOS type commands in Windows, executing </p> <pre><code>dir /a:-d </code></pre> <p>will show only files in the directory but not the '.' and '..' entries. while </p> <pre><code>dir *.txt </code></pre> <p>would list only .txt files in the directory.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload