Sample code for 30+ languages & platforms
Visual FoxPro

Demonstrate Directory Path Functions

Demonstrates the path functions GetDirectoryName, GetExtension, GetFileName, and GetFileNameWithoutExtension.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL loFac

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