when we specify the file path some times we specify like ./filename
and some time ../filename
what is difference between these two?
The difference between ./ and ../
filesystems
Related Solutions
Size is the actual size of the file in bytes.
Size on disk is the actual amount of space being taken up on the disk. They differ because the disk is divided into tracks and sectors, and can allocate blocks of discrete size.
Editing
For a more detailed explanation, see this text which I copied from another site:
We know that a disk is made up of Tracks and Sectors. In Windows that means the OS allocates space for files in "clusters" or "allocation units".
The size of a cluster can vary, but typical ranges are from 512 bytes to 32K or more. For example, on my C:\ drive, the allocation unit is 4096 bytes. This means that Windows will allocate 4096 bytes for any file or portion of a file that is from 1 to 4096 bytes in length.
If I have a file that is 17KB (kilo bytes), then the Size on disk would be 20.48 KB (or 20480 bytes). The calculation would be 4096 (1 allocation unit) x 5 = 20480 bytes. It takes 5 allocation units to hold a 17KB file.
Another example would be if I have a file that is 2000 bytes in size. The file size on disk would be 4096 bytes. The reason is, because even though the entire file can fit inside one allocation unit, it still takes up 4096 of space (one allocation unit) on disk (only one file can use an allocation unit and cannot be shared with other files).
So the size on disk is the space of all those sectors in which the file is saved. That means,usually, the size on disk is always greater than the actual size.
So the actual size of a file(s) or folder(s) should always be taken from the Size value when viewing the properties window.
Source: What's The Difference Between Size And Size On Disk In Windows Folder Properties.
C:FILE.TXT
refers to FILE.TXT
in the current directory of drive C:
C:\FILE.TXT
refers to FILE.TXT
in the root directory of drive C:
(C:\
)
They are not the same.
Edit: Command Prompt Example:
Windows remembers a current working directory for each drive. Say you are working in directory C:\UTILS
and then you change to drive F:
and then to directory BIN
on F:
:
C:\UTILS> F: F:\> CD BIN F:\BIN>
At this point the current working directory for C:
is still C:\UTILS
and the current working directory for F:
is F:\BIN
You can verifiy this with the CD
command:
F:\BIN> CD C: C:\UTILS F:\BIN>
Note that you did not change the working drive back to C:
by using this command.
As you will see from the following command examples, the use of a backslash (\
) immediately after a drive name (X:
) makes the file location absolute. Ommiting the backslash automatically involves the current working directory for the drive.
F:\BIN> COPY F:PROGRAM.EXE C: Copies* F:\BIN\PROGRAM.EXE to C:\UTILS\PROGRAM.EXE F:\BIN> COPY F:PROGRAM.EXE C:\ Copies* F:\BIN\PROGRAM.EXE to C:\PROGRAM.EXE F:\BIN> COPY F:\PROGRAM.EXE C: Copies* F:\PROGRAM.EXE to C:\UTILS\PROGRAM.EXE F:\BIN> COPY F:PROGRAM.EXE C:NEW\NEW_PROG.EXE Copies* and renames F:\BIN\PROGRAM.EXE to C:\BIN\NEW\NEW_PROG.EXE
* 'Copies' means 'attempts to copy'. These commands will fail if the assumed directory structures and current working directories don't exist or are changed by another process.
In the case where the working directory is the root directory (eg. C:\
) then C:PROGRAM.EXE
and C:\PROGRAM.EXE
point to the same location, but they have been arrived at by different methods.
Best Answer
../
refers to the parent folder while./
means the current folder