| | |
Get path to file found by FindFirstFile
Thread Solved
![]() |
•
•
Join Date: Dec 2008
Posts: 2
Reputation:
Solved Threads: 0
Hi,
I'm using FindFirstFile and FindNextFile functions to get a list of
files from a path specified by the user.
Let's say the current directory has a sub-directory named 'subDir1'
which has a file named 'file1.txt'.
myDir <- pwd
|_ subDir1
|_ file1.txt
Now, if the user enters 'subDir1\*' as the input argument I know how
to use FindFirstFile and FindNextFile to get 'file1.txt' but I also
need to be able to retrieve the path to 'file1.txt', either absolute
or relative to the current directory. Is there any way to do this?
Thanks for your help in advance,
Ashish.
I'm using FindFirstFile and FindNextFile functions to get a list of
files from a path specified by the user.
Let's say the current directory has a sub-directory named 'subDir1'
which has a file named 'file1.txt'.
myDir <- pwd
|_ subDir1
|_ file1.txt
Now, if the user enters 'subDir1\*' as the input argument I know how
to use FindFirstFile and FindNextFile to get 'file1.txt' but I also
need to be able to retrieve the path to 'file1.txt', either absolute
or relative to the current directory. Is there any way to do this?
Thanks for your help in advance,
Ashish.
>> Is there any way to do this?
check the user input string to see if it contains a path -- e.g. the '\' or '/' character (path separators can be either character in MS-Windows os). Copy that part in another string so that you can use it whanever needed.
check the user input string to see if it contains a path -- e.g. the '\' or '/' character (path separators can be either character in MS-Windows os). Copy that part in another string so that you can use it whanever needed.
Last edited by Ancient Dragon; Dec 10th, 2008 at 12:34 am.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Similar Threads
- Browsing through files in folders, the compare (C++)
- Iterator assertion failure. How? (C++)
- Neophyte requests assistance... (C++)
- FindFirstFile & FindNextFile return extra files? (C++)
Other Threads in the C++ Forum
- Previous Thread: Making a GUI in Unix?
- Next Thread: Assertion Failure???
| Thread Tools | Search this Thread |
ace_thread api array based binary bitmap borland c++ c/c++ calling char class classes code coding compile console conversion count delete delete-line deploy desktop developer directshow dll download dynamic dynamiccharacterarray email embedded encryption error file forms fstream function functions game givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream information input int integer java lib linkedlist linker loop looping loops map math mathhomeworkhelp matrix memory multiple news node number numbertoword output parameter pointer problem program programming project python random read recursion reference reverse richedit rpg string strings temperature template test text text-file tree url variable vector video win32 windows winsock word wordfrequency wxwidgets






