General information
Category:
Coding, syntax & commands
>>hello all!
>>
>>I would like to know how i do to dicover the path for a file, where i have only the name from file, by sample i would like to know where is filename.xxx, but i don´t know what is your folder.
>>
>
>You could search for it from the root recursively using something like ADIR(), driling down through the file system until it is found.
>
>If you know a relative path for the file (ie FILE(cFileName) returns .T.), you can retrieve the fully-qualified pathname using FULLPATH(cFileName).
The only problem I have had with using FULLPATH() is that if the file does not exist in the FP path, it just returns the current directory name and path, so it is really important to check for the existence of the file first. And if it isn't in the current FP path, but still on the machine or server, you won't get FILE(xxx) = .T. Also, beware if the same filename exists in more than one place in the FP path, FULLPATH() will only return the fully qualified filename of the first one found... This really drove me nuts on debugging an app a few year ago from another developer who was sloppy about file names and locations....
HTH
Rob
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only