Tech Tip: A quick way to get the platform-specific folder delimiter character
PRODUCT: 4D | VERSION: 11.3 | PLATFORM: Mac & Win
Published On: March 25, 2009
You can find the path to your database folder using Get 4D Folder. Accessing a subfolder within the database folder would require a path to the folder.
At this point, it is necessary to verify the platform type and get the folder delimiter. For Mac OS X, it is ":" and for Windows it is "\" . Using this information, you can construct the full path to the subfolder. This can be done very quick and easy without finding the platform type.
If we look at the path returned from Get 4D Folder, we see that the last element is actually the OS delimiter. We can extract the folder delimiter character by using just two lines of code. An example follows; $folderDelimiter holds the OS specific character after execution.
C_TEXT($folderDelimiter;$folderPath) $folderPath:=Get 4D Folder(Database_Folder) $folderDelimiter:=$folderPath[[Length($folderPath)]] |
$delim:=(Get 4D folder(Database Folder )[[Length(Get 4D folder(Database Folder ))]])