Path Operations

Console Output
>

Path Operation Visualization

Path Structure:
examplepathfile.txt
Path Components:
Directory:example
Basename:file.txt
Extension:.txt
Operation Result
example/path/file.txt
Method Explanation:
  • The join() method is used to join one or more path components together.
  • The split() method is used to split a path into a directory and file name.
  • The basename() method is used to get the file name from a path.
  • The dirname() method is used to get the directory name from a path.
  • The exists() method is used to check if a file or directory exists.
  • The absolute() method is used to get the absolute path of a file or directory.