KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Renaming a Mac directory with LAUNCH EXTERNAL PROCESS
PRODUCT: 4D | VERSION: 11.6 | PLATFORM: Mac OS X
Published On: June 24, 2010

Developers can use the LAUNCH EXTERNAL PROCESS command to rename Mac OS X folders. The following code snippet uses the mv UNIX command to rename "MyOldFolder" to "MyNewFolder".

C_TEXT($source;$target)

$source:="/Users/someUserName/Documents/MyOldFolder"
$target:="/Users/someUserName/Documents/MyNewFolder"
LAUNCH EXTERNAL PROCESS("mv -f "+$source+" "+$target)


The syntax of mv command follows:

mv [-f | -t | -n] [-v] source target

Where:

  • -f : mv does not prompt for confirmation before overwriting the destination folder

  • -i : mv writes a prompt to the standard error before moving a file that overwrites an existing file

  • -n : mv does not overwrite existing file

  • -v : mv shows files after they are moved