Perl ABC

  1. Perl
  2. ›
  3. File operations

File/directory operation

We have summarized how to create/delete/copy files/directories.

Basic knowledge of file names

  • Absolute and relative paths
  • Representation of the hierarchy above the directory ..

Handling of file names

  • Extract the directory name and base name from the file name
  • Extract the extension from the file name
  • Convert the file name to the file name in the OS of the execution environment

File operation

  • Create a file
  • Delete the file
  • Copy the file
  • Move files

Directory operation

  • Create a directory
  • Delete the directory
  • Rename the directory
  • Change the current directory
  • Get the current directory name
  • Get the list of files in the current directory

Recursive directory manipulation

  • Create a multi-level directory
  • Delete directories with hierarchy at once
  • Recursively process all files

Permissions

Explains file permissions on Unix/Linux.

  • Understand permissions

Script information

  • Get the script name $0
  • Get the directory name of the execution script - FindBin
  • Get the package name
  • Get the line number on the script
  • Get the script file name

Related Informatrion

  • News
  • Free Online Courses
  • Twitter
Perl Club