Verification Methods

isExecutable

Returns true if the file is executable.

/**
 * @path The file path
 *
 * @throws cbfs.FileNotFoundException - If the filepath is missing
 */
boolean function isExecutable( required path );

// Example
if ( disk.isExecutable( "myFile.txt" ) ) {
    // Execute the file
}

isFile

Verifies if the passed path is an existent file.

/**
 * @path The file path
 *
 * @throws cbfs.FileNotFoundException
 */
boolean function isFile( required path );

// Example
if ( disk.isFile( "myFile.txt" ) ) {
    // Read the file
}

isHidden

Returns true if the file is hidden.

/**
 * @path The file path
 *
 * @throws cbfs.FileNotFoundException - If the filepath is missing
 */
boolean function isHidden( required path );

// Example
if ( !disk.isHidden( "myFile.txt" ) ) {
    // Read the file
}

isReadable

Returns true if the file is readable.

/**
 * @path The file path
 *
 * @throws cbfs.FileNotFoundException - If the filepath is missing
 */
boolean function isReadable( required path );

// Example
if ( disk.isReadable( "myFile.txt" ) ) {
    // Read the file
}

Returns true if the file is a symbolic link.

/**
 * Is the file is a symbolic link
 *
 * @path The file path
 *
 * @throws cbfs.FileNotFoundException - If the filepath is missing
 */
boolean function isSymbolicLink( required path );

// Example
if ( !disk.isSymbolicLink( "myFile.txt" ) ) {
    // Read the file
}

isWritable

Returns true if the file is writable.

/**
 * @path The file path
 *
 * @throws cbfs.FileNotFoundException - If the filepath is missing
 */
boolean function isReadable( required path );

// Example
if ( disk.isWritable( "myFile.txt" ) ) {
    // Write to the file
}

Last updated