When i search for files using winapi, i usually come across 2 files/folders. (Am calling them files/folders since i get them as a result when i search for files.)
What are these exactly?
I tried google but...
Printable View
When i search for files using winapi, i usually come across 2 files/folders. (Am calling them files/folders since i get them as a result when i search for files.)
What are these exactly?
I tried google but...
. stands for the current folder
.. for the parent folder
If you launch a command prompt and do a dir, you would see the same
It are folders. They represent the current folder '.' and the parent folder '..'
Did you never typed in a console:
?Code:cd ..
Thanks.Quote:
Originally Posted by kirants
what is the use of this?
and..I dont get something,
what is the use of the dot for current folder, when u r in the current folder. :confused:
Any links would be great.
Never wondered why, until now. :DQuote:
Originally Posted by cilu
Good question :thumb: and I don't know why :oQuote:
Originally Posted by Vedam Shashank
Seems to be some kind of DOS legacy thing.
I think it's rather Unix related.Quote:
Originally Posted by kirants
http://en.wikipedia.org/wiki/Path_(computing)
The use is obvious, you dont need to type specific name to access current or parent folder, using dot(s) make it generic.Quote:
Originally Posted by Vedam Shashank
I could be useful if you want to list all the folders which can be reached form a certain location.Quote:
Originally Posted by Vedam Shashank
If your current location is C:\MyFolder\ then you could list all the reachable folders as
C:\MyFolder\.\
C:\MyFolder\..\
C:\MyFolder\FirstSubfolder\
C:\MyFolder\SecondSubfolder\
etc.
But I agree it seems a bit redundant.
"." can be used as a shorthand for many commands. for example the subst command
will mount the current directory as a drive ( z: ). You need not type the entire path to accomplish this. Though this existed from DOS(AFAIK), they are quite handy and are kept around. Depending upon the directory/file structure the ".." may point back to the parent directory. This way file recovery softwares can identify and/or resolve conflicts in folders if some corruption occurs to the directory/ file structure.Code:subst z: .
Hi,
It is certainly unix or linux related. (..) and (.) came from unix. In DOS (..) makes sense but not (.). but in unix to execute a executable(!!) you need to specify the path.Unlike DOS Even the Current directly should be explicitly mentioned.
For example.. Many would know to execute a C program in linux or unix after compiling you need to type .\a.out.
.\a.out ==> CURRENTDIRECTORY\a.out
bye
P.Somasundaram
The reason for this is (among other things) that some systems were compromized by changing the PATH variable. In unix PATH may have priority over the current directory.
So, if PATH points to a directory that contains a malicious executable file with the same name as a file in the current directory, typing "myexe" would excute that malicious file while "./myexe" would execute the file in the current directory.