This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19.8
file.create( )

file.create( ) 


 

file.create -> Result 
Parameter Type   Description
Result  Boolean in True if the file was created successfully, false otherwise

The file.create( ) method creates a file on disk according to the properties of the file object.

If necessary, the function creates the folder hierachy as described in the file.platformPath or file.path properties. If the file already exists on disk, the function does nothing (no error is thrown) and returns false.

Returned value

  • true if the file is created successfully;
  • false if a file with the same name already exists or if an error occured.

Example  

Creation of a preferences file in the database folder:

 C_BOOLEAN($created)
 $created:=File("/PACKAGE/SpecialPrefs/"+Current user+".myPrefs").create()

 
PROPERTIES 

Product: 4D
Theme: File and Folder

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v17 R5

 
ARTICLE USAGE

4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)
4D Language Reference ( 4D v19.4)
4D Language Reference ( 4D v19.5)
4D Language Reference ( 4D v19.6)
4D Language Reference ( 4D v19.7)
4D Language Reference ( 4D v19.8)