4D v13.4

Description of 4D files

Home

 
4D v13.4
Description of 4D files

Description of 4D files  


 

 

4D creates several files and folders by default for each application. Additional files are also used when the application has been converted from a previous version.

When you create a database, the following files and folders are generated by default on the disk:  

  • A structure file (“.4DB” extension)
    The structure file contains all the specifications concerning the database structure (tables, fields, field properties), forms, methods, menus, passwords and choice lists. The structure file takes the name that you enter in the database creation dialog box, followed by “.4db”.
  • A data file (“.4DD” extension)
    The data file contains the data that are entered in the records and all the data that belong to the records. The data file takes the name that you enter in the database creation dialog box, followed by “.4db”.
    When you open a 4D structure file, the application opens the current data file by default. If you change the name or location of this file, the Open data file dialog box will then appear so that you can select the data file that you want to use or create a new one (see Changing the data file).
    A data file is automatically associated with the structure file that created it in order to avoid any incorrect handling.
  • A structure index file (“.4DIndy” extension) and a data index file (“.4DIndx” extension)
    Indexes created in a 4D database are stored as separate files. These files are automatically placed next to the structure file. They must not be moved or renamed; otherwise, 4D will have to create them again.
    DatabaseName.4DIndx contains the data indexes and DatabaseName.4DIndy contains the structure indexes (used in particular when searching the structure). One of the main advantages is that if the index becomes corrupted, it is possible to physically remove the file before launching 4D so that it will be created anew automatically.
  • A data log file (“.journal” extension) — file created only when the database uses a log file.
    The log file is used to ensure the security of the database data between two backups. All the operations carried out on the data of the database are recorded sequentially in this file. So each operation on the data causes two simultaneous actions: the first on the database data (the statement is executed normally) and the second in the log file (a description of the operation is recorded). The log file is constructed independently, without disturbing or slowing down the user’s work. A database can only work with one log file at a time.
    The log file records operations such as additions, modifications or deletions of records, transactions, etc. It is generated by default when a database is created. For more information, refer to Managing the log file.
  • A Resources folder, containing external resources.
    The Resources folder, which must be located next to the database structure file (.4db or .4dc), is intended to contain all the files needed for the database interface.
    In this folder, you can place all the files needed for the translation or customization of the application interface (picture files, text files, XLIFF files, etc.). 4D uses automatic mechanisms to work with the contents of this folder, in particular for the handling of XLIFF files (see Appendix C: XLIFF architecture) and pictures (see Using static pictures).
    In the context of use in remote mode, the Resources folder lets you share files between the server machine and all the client machines. For more information, refer to Managing the Resources folder in the 4D Server Reference Manual.
  • A Preferences folder, containing the configuration files specific to the database — folder only created when necessary.
    The Preferences folder stores the configuration files of the database, generally in XML format. It is created automatically, more specifically when using the backup function (Backup.xml file) or the application builder function (BuildApp.xml file).
  • A Logs folder containing the log files of the current database. This folder is found at the same level as the structure file. It groups together the following log files:
    • database conversion,
    • Web server requests,
    • data verification and repair,
    • structure verification and repair,
    • backup/restore activities journal,
    • command debugging,
    • 4D Server requests (generated on client machines and on the server).
    These files and folders are initially placed in the same folder when the database is created; it is recommended to not move them so as not to affect the automatic mechanisms of 4D.

When you use a database created with a 4D version prior to v11, additional files are present:

  • A structure resources file (“.RSR” extension)
    This file contains the “former” Macintosh type resources associated with the database structure.
    The .4DB and .RSR files must always be placed in the same directory and have the same name, otherwise you will not be able to open the database.
  • A data resources file (“.4DR” extension)
    This file contains the “former” resources associated with the data of the database.
For more information about converting databases, refer to the DELETE USER paragraph.

By default, 4D databases are automatically created in a folder suffixed .4dbase. For example, a database named “Invoices” will be created in the folder [Invoices.4dbase]. This folder stores all the elements needed for the proper functioning of the database.

Because of this, under Mac OS database folders appear as packages. It is possible to double-click on the package to launch 4D, the database and the current data file directly. It is also possible to drag and drop the package onto the 4D application icon. This also means that the database can be placed in a version management tool.
Under Windows, this functioning has no particular impact. 

You can disable this default functioning by unchecking the Create package for new databases option on the General Page of the Preferences.

 
PROPERTIES 

Product: 4D
Theme: Managing 4D files