(Visual FoxPro) Demonstrate Directory Path Functions
Demonstrates the path functions GetDirectoryName, GetExtension, GetFileName, and GetFileNameWithoutExtension.
LOCAL loFac
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.FileAccess')
loFac = CreateObject('Chilkat.FileAccess')
* Note: Chilkat accepts either forward slash or backslash chars as directory separators..
? loFac.GetDirectoryName("/MyDir/MySubDir/myfile.ext")
? loFac.GetDirectoryName("/MyDir/MySubDir")
? loFac.GetDirectoryName("/MyDir/")
? loFac.GetDirectoryName("/MyDir")
? loFac.GetDirectoryName("/")
? loFac.GetExtension("C:/mydir.old/myfile.ext")
? loFac.GetExtension("C:/mydir.old/")
? loFac.GetFileName("C:/mydir/myfile.ext")
? loFac.GetFileName("C:/mydir/")
? loFac.GetFileNameWithoutExtension("C:/mydir/myfile.ext")
? loFac.GetFileNameWithoutExtension("C:/mydir/")
? "---"
RELEASE loFac
|