4D v17.4

Get 4D file

Home

 
4D v17.4
Get 4D file

Get 4D file 


 

Get 4D file ( file {; *} ) -> Function result 
Parameter Type   Description
file  Longint in File type
Operator in Return file path of host database
Function result  String in Pathname to 4D file

The Get 4D file command returns the pathname to the 4D environment file specified by the file parameter. The path is returned using the system syntax.

This command allows you to get the actual pathname of specific files, whose name or location can depend on database context. It also helps you to write generic code which is independent from the 4D version or the OS.

In file, pass a value to specify the file for which you want to get the full pathname. You can use one of the following constants, located in the "4D Environment" theme:

Constant Type Value Comment
Backup configuration file Longint 1

Backup.xml file, stored in Preferences/Backup folder next to database structure file.

Backup log file Longint 13

Current backup journal file. Stored in the Logs folder next to database structure file.

Build application log file Longint 14

Current log file in xml format of the application builder. Stored in the Logs folder next to database structure file. 

Compacting log file Longint 6

Log file of the most recent compacting done with the Compact data file command or the Maintenance and security center. Stored in the Logs folder next to database structure file.

Debug log file Longint 12

Log file created by the SET DATABASE PARAMETER(Debug log recording) command. Stored in the Logs folder next to database structure file. 

Diagnostic log file Longint 11

Log file created by the SET DATABASE PARAMETER(Diagnostic log recording) command. Stored in the Logs folder next to database structure file. 

HTTP debug log file Longint 9

Log file created by the WEB SET OPTION(Web debug log) command. Stored in the Logs folder next to database structure file. 

HTTP log file Longint 8

Log file created by the WEB SET OPTION(Web log recording) command. Stored in Logs folder next to database structure file. 

Last backup file Longint 2 Last backup file, named <databaseName>[bkpNum].4BK, stored at a custom location.
Repair log file Longint 7

Log file of database repairs made on the database in the Maintenance and Security Center (MSC). Stored in the Logs folder next to database structure file. 

Request log file Longint 10

Standard client/server request log file (excluding Web requests) created by the SET DATABASE PARAMETER(4D Server log recording) or SET DATABASE PARAMETER(Client log recording) commands. If executed on the server, the server log file is returned (stored in the Logs folder on the server). If executed on the client, the client log file is returned (stored in the client local Logs folder). 

User settings file Longint 3 settings.4DSettings file for all data files, stored in Preferences folder next to database structure file if enabled.
User settings file for data Longint 4 settings.4DSettings file for current data file, stored in Preferences folder next to the data file.
Verification log file Longint 5

Log files created by the VERIFY CURRENT DATA FILE and VERIFY DATA FILE commands or the Maintenance and Security Center (MSC). Stored in the Logs folder next to database structure file. 

When the command is called from a component, pass the optional * parameter to get the file path of the host database. In this case, if you omit the * parameter, an empty string is always returned. 

Regarding User settings file for data and User settings file, a path is returned only if the Enable User Settings in External File security option has been checked in the "Database Settings" dialog box (see Enabling User Settings mode).

Example  

You want to get the path of the last backup file:

 C_TEXT($path)
 $path:=Get 4D file(Last backup file)
  // $path = "C:\Backups\Countries\Countries[0025].4BK" for example

 
PROPERTIES 

Product: 4D
Theme: 4D Environment
Number: 1418

This command can be run in preemptive processes

 
HISTORY 

Created: 4D v16
Modified: 4D v16 R6

 
ARTICLE USAGE

4D Language Reference ( 4D v17)
4D Language Reference ( 4D v17.1)
4D Language Reference ( 4D v17.2)
4D Language Reference ( 4D v17.3)
4D Language Reference ( 4D v17.4)