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.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by praetorian20
0

>> 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.

0

>> 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.

Thanks Dragon, that works!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.