Search code examples
dos

MS-DOS file/directory characteristics


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?


Solution

  • 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