(Tcl) Demonstrate Directory Path Functions
Demonstrates the path functions GetDirectoryName, GetExtension, GetFileName, and GetFileNameWithoutExtension.
load ./chilkat.dll
set fac [new_CkFileAccess]
# Note: Chilkat accepts either forward slash or backslash chars as directory separators..
puts [CkFileAccess_getDirectoryName $fac /MyDir/MySubDir/myfile.ext]
puts [CkFileAccess_getDirectoryName $fac /MyDir/MySubDir]
puts [CkFileAccess_getDirectoryName $fac /MyDir/]
puts [CkFileAccess_getDirectoryName $fac /MyDir]
puts [CkFileAccess_getDirectoryName $fac /]
puts [CkFileAccess_getExtension $fac C:/mydir.old/myfile.ext]
puts [CkFileAccess_getExtension $fac C:/mydir.old/]
puts [CkFileAccess_getFileName $fac C:/mydir/myfile.ext]
puts [CkFileAccess_getFileName $fac C:/mydir/]
puts [CkFileAccess_getFileNameWithoutExtension $fac C:/mydir/myfile.ext]
puts [CkFileAccess_getFileNameWithoutExtension $fac C:/mydir/]
puts "---"
delete_CkFileAccess $fac
|