Absolute path of the file to reference.
References a file. The file does not have to exist.
var myFolder = new Folder( 'PROJECT/' );
var myFile = new File( myFolder, 'bootstrap.js' );
console.log( myFile.exists );
// true
var myFolder = new Folder( 'PROJECT/' );
var myFile = new File( myFolder, 'file-to-create.js' );
console.log( myFile.exists );
// false
Folder containing the file
Name of the file to reference in the folder path
Check if the path references a file.
var myIsFile = File.isFile( 'PROJECT/bootstrap.js' );
console.log( myIsFile );
// true
Absolute path to a file
true
is the path references a file, false
otherwise.
References a file. The file does not have to exist.
Example 1: Get a reference to an existing file
var myFile = new File( 'PROJECT/bootstrap.js' ); console.log( myFile.exists ); // true
Example 2: Get a reference to a missing file
var myFile = new File( 'PROJECT/file-to-create.js' ); console.log( myFile.exists ); // false