cbfs
  • Introduction
  • Intro
    • Release History
    • About This Book
  • Getting Started
    • Installation
    • Providers
      • Local Provider
      • RAM Provider
      • S3 Provider
  • Usage
    • Disk Service
    • Disk Usage
      • Configuration Methods
      • File Methods
      • File Object
      • Directory Methods
      • Utility Methods
      • Stream Methods
      • Verification Methods
  • Digging Deeper
    • Interceptors
    • Module Disks
    • Custom Providers
Powered by GitBook
On this page
  • isExecutable
  • isFile
  • isHidden
  • isReadable
  • isSymbolicLink
  • isWritable

Was this helpful?

Edit on GitHub
Export as PDF
  1. Usage
  2. Disk Usage

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
}

isSymbolicLink

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
}

PreviousStream MethodsNextInterceptors

Last updated 2 years ago

Was this helpful?