KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Command line interface and 4DLink files
PRODUCT: 4D | VERSION: 12 | PLATFORM: Mac & Win
Published On: November 9, 2011

As decribed in the Tech Tip Using the Command Line Interface in 4D v11 SQL, the Command Line Interface can be used to open databases by specifying the path to the executable, the structure file, and the data file.

In addition to this, it is also possible to use a 4DLink file instead of specifying the structure and data files. This works because the 4DLink file can contain both paths to the structure and data files.

Here is an example of the the contents of a 4DLink file that can be used to open a specific database:

<?xml version="1.0" encoding="UTF-8"?>
<database_shortcut
   structure_opening_mode="1"
   structure_file="file:///PATH_TO_DATABASE/mydb.4DB"
   data_file="file:///PATH_TO_DATABASE/mydb.4DD"
/>


This file could then be used to open the database usin the following commands:

Mac OS:
   /Applications/PATH_TO_4D/4D.app/Contents/MacOS/4D /PATH_TO_4DLINK/mydatabase.4DLink


Windows OS:
   C:\PATH_TO_4D\4D.exe c:\PATH_TO_4DLINK\mydatabase.4DLink