Programmers: quick c question

TranceNation

Platinum Member
Jan 6, 2001
2,041
0
0
is there a library call to find a file on a hd and return back the directory that it is located?
thx
 

Kntx

Platinum Member
Dec 11, 2000
2,270
0
71
If you're talking windows, check msdn for something. It seems like the sort of thing that would be part of the winapi.
 

GermyBoy

Banned
Jun 5, 2001
3,524
0
0
Definately. But...it's OS dependant so you need to look it up.

And yes and no for the "going to the directory it's located." The program never sits in a directory ever. It has a default directory where it will look for things, etc. but when you open something or list the directory, you need to specify the entire path if it is not a local path (ie the path the program is in).
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Since you're on Windows you need FindFirstFile, FindNextFile and friends. Look it up in MSDN and you'll have all the information you need.
 

Zombie

Platinum Member
Dec 8, 1999
2,359
1
71
yep check MSDN documentation needless to say program won't work on unix.