Reputation: 283
Whenever we create any new file in MS-DOS then by default it creates directories like "." and "..". What are these directories and how is it helpful to the operating system? Also is there any way to delete them?
Upvotes: 1
Views: 787
Reputation: 37222
The "." directory is a pointer to the directory it resides in.
The ".." directory is a pointer to the parent directory.
Examples
C:\Temp\.\SomeFolder\
is the same directory as C:\Temp\SomeFolder
, C:\Temp\..\SomeFolder\
is the same directory as C:\SomeFolder\
.EDIT
An absolute path in DOS is one which is "rooted" (i.e. it starts with the volume). An example will be
volume
C:\someFolder\someFile.txt
A relative path is one which is dependent on the current directory. For example:
REM Change the directory to an absolute path
CD C:\Data\Movies
REM Now change the directory to "C:\Data\Music" using a relative path.
REM We are saying "The Music folder, inside the parent folder of C:\Data\Movies"
CD ..\Music
Upvotes: 2
Reputation: 1852
The .
and ..
directories are links to itself and its parent directory, respectively.
It is not possible to delete them.
The purpose of the ..
directory is so that you can navigate back to a directory's parent. The purpose of the .
directory is to be able to refer to the current directory having to specify the entire name and path.
Upvotes: 2