>fso = CreateObject('Scripting.FileSystemObject') >fx = fso.GetFile('..\..\tmp\2003vkt.pdf') >?fx.Name && 2003VKT.pdf >?fx.Path && C:\tmp\2003VKT.pdf >?fx.ShortPath && C:\tmp\2003VKT.pdf >>_____
>>> >>>?DiskFileName('C:\Whatever\Folder\or\Filename\) >>>*--------------------------------------------------------------------------- >>>#Define MAX_PATH 260 >>>function DiskFilename(FileName) >>> >>> declare Integer FindFirstFile in win32api string @, String @ >>> declare Integer FindNextFile in win32api Integer, String @ >>> declare Integer FindClose in win32api Integer >>> >>> do case >>> case ( right(FileName,1) == '\' ) >>> return addbs(DiskFilename(left(FileName, len(Filename)-1))) >>> >>> case empty(FileName) >>> return '' >>> >>> case ( len(FileName) == 2 ) and ( right(FileName,1) == ':' ) >>> return Filename && win2k gives curdir() for C: >>> endcase >>> >>> local Handle, FindFileData, xxx >>> FindFileData = space(4+8+8+8+4+4+4+4+MAX_PATH+14) >>> Handle = FindFirstFile(@FileName, @FindFileData) >>> >>> if( Handle < 0 ) >>> if( !empty(JustFname(Filename)) ) >>> xxx = JustFname(Filename) >>> else >>> xxx = FileName >>> endif >>> else >>> =FindClose(Handle) >>> xxx = substr(FindFileData, 45, MAX_PATH) >>> xxx = left(xxx, at(chr(0), xxx)-1) >>> endif >>> >>> >>> do case >>> case empty(justpath(FileName)) >>> return xxx >>> case ( justpath(FileName) == '\' ) and (left(FileName,2) == '\\') && unc >>> return '\\' + xxx >>> otherwise >>> return addbs(DiskFilename(JustPath(FileName))) + xxx >>> endcase >>> >>>endfunc >>>*-------------------------------------------------------------------------- >>>