Page 1 of 1
Get filename full path
Posted: Fri Jun 15, 2012 6:06 pm
by CenturyMan1979
So I have a small script that I call to get the list of file in a particular directory,
Code: Select all
function getListOfFiles pDir
local tOldDir, tFiles
put the directory into tOldDir
set the directory to pDir
put the files into tFiles
set the directory to tOldDir
return tFiles
end getListOfFiles
Only thing is that the returned files are only the names of the files. Is there some way of getting the list with full paths without appending it in the function myself? Some paths are relative and others are absolute if that makes a difference.
Re: Get filename full path
Posted: Fri Jun 15, 2012 6:37 pm
by Klaus
Hi CenturyMan1979,
CenturyMan1979 wrote: Is there some way of getting the list with full paths without appending it in the function myself?
in short, no
"the files" always returns the bare filenames, you need to take care of adding the missing part of the absolute filename.
Best
Klaus
Re: Get filename full path
Posted: Fri Jun 15, 2012 6:41 pm
by jmburnod
Hi CenturyMan1979,
You can use a custompropertie of a control or a local variable to keep the path of the folder
Best regards
Jean-Marc
Re: Get filename full path
Posted: Fri Jun 15, 2012 6:55 pm
by BvG
put the directory & "/" & line 1 of the files --i prefer to use 'the defaultFolder' because it describes better what it contains, but whatever works

Re: Get filename full path
Posted: Fri Jun 15, 2012 7:35 pm
by mwieder
without appending it in the function
Is there some reason you need to avoid this?
Re: Get filename full path
Posted: Fri Jun 15, 2012 7:41 pm
by CenturyMan1979
mwieder wrote:without appending it in the function
Is there some reason you need to avoid this?
Just curious if there was something out there already that could be used like, put the filepath & itemDel & the filename of me . Turns out there is not.