Perl Tutorials - Herong's Tutorial Examples
Dr. Herong Yang, Version 5.00

File System Functions and Operations

This chapter provides tutorial examples and notes about file system functions and operations. Topics include using built-in functions to create and remove directories; using unlink() to delete files; using file test operators; using stat() to return file statistics.

Built-in Functions to Work with the File System

File Test Operators

stat() - Returns File Statistics

Conclusions:

  • chdir(), mkdir(), rmdir(), and unlink() are functions to manage directories.
  • -e, -d, -f, -s, -T, -B are file test operators to return file information.
  • stat() returns all statistics of a file as a list value.

Dr. Herong Yang, updated in 2008
File System Functions and Operations