You can use a command line in the Mac OS X Terminal to drive your 4D applications (4D and 4D Server). This function allows you to open or close a database remotely, which can be particularly useful for administering Web servers.
To be able to execute most 4D commands using the Mac OS X Terminal, you must first access the folder where the application is found inside the package (Contents/MacOS path).
For example, if the 4D package is located in the MyFolder folder, you must write the command line as follows:
/MyFolder/4D.app/Contents/MacOS/4D
Note: You can also insert the command line using drag and drop with the application icon in the Terminal.
It is recommended that you pass the “&” character at the end of the command line so that the application is executed as a background task in a separate process. For example:
/MyFolder/4D.app/Contents/MacOS/4D &
Here is a description of command lines and their arguments which are supported by 4D applications:
- Quit application
Syntax: kill -s INT process_ID
Example:
Kill -s INT 323
The action of this command is identical to selecting the Quit command. The processes are shut down one by one; the cache is saved; and the application quits.
Note: The process number of the 4D application (process_ID) can be obtained using commands such as ps or top.