ePages 6.11.0 - DE_EPAGES/Core/API/Command.pm

Package DE_EPAGES::Core::API::Command

Implements script commands for use in platform-independend make files. See also: perldoc ExtUtils::Command

Example
perl -MDE_EPAGES::Core::API::Command=chown -e chown user:group files
@EXPORT
copy_dir
copy_file
empty_dir
delete_dir

Functions

chmod
chown
copy_dir
copy_file
delete_dir
empty_dir
test

chmod

Changes the file permissions on Unix using the "chmod" system command. Does nothing on Windows.

Syntax
perl -MDE_EPAGES::Core::API::Command=chmod -e chmod -R 750 files

chown

Changes the file ownership on Unix using the "chown" system command.. Does nothing on Windows.

Syntax
perl -MDE_EPAGES::Core::API::Command=chown -e chown -R user:group files

copy_dir

Copies a source directory recursively to a target directory. The target directory is created if it does not exist yet.

Syntax
perl -MDE_EPAGES::Core::API::Command -e copy_dir [options] source target
Input
source (string)
source directory
target (string)
target directory
-backup dir (string)
backup directory
-ifexists file (string)
do nothing if the specified file or directory does not exist
Return
exit code (int)
0 if successful

copy_file

Copies a source file to a target file. The target directory is created if it does not exist yet.

Syntax
perl -MDE_EPAGES::Core::API::Command -e copy_file [options] source target
Input
source (string)
source file name
target (string)
target file name
-ifexists file (string)
do nothing if the specified file or directory does not exist
Return
exit code (int)
0 if successful

delete_dir

Deletes the directory and all its content.

Syntax
perl -MDE_EPAGES::Core::API::Command -e delete_dir dir
Input
dir (string)
directory name
Return
exit code (int)
0 if successful

empty_dir

Deletes all files and sub directories of a directory, but not the directory itself. Fails if the directory does not exist (except when -ifexists is used).

Syntax
perl -MDE_EPAGES::Core::API::Command -e empty_dir [options] dir
Input
dir (string)
directory name
-ifexists file (string)
do nothing if the specified file or directory does not exist
Return
exit code (int)
0 if successful

test

Tests if a file system name (file or directory) exists.

Syntax
perl -MDE_EPAGES::Core::API::Command=test -e test file
echo %ERRORLEVEL%
Input
file (string)
file or directory name
Return
exit code (int)
0 if file exists, 1 if the file does not exist