filecommands.rwl − Perform various Operating System commands
$include:<filecommands.rwl>
function maketempdir() return string
procedure removetempdir(string dirname)
function makedir(string dirname) return integer
procedure copyfile(string src, string dst)
The filecommands.rwl script includes functions and procedures that perform generarally useful Operating System commands when dealing with directories and files.
The procedures and functions can be used unchanged on Linux and Microsoft Windows.
maketempdir()
Create a directory with a temporary name and return the name. If there is an error during execution, an empty string will be returned. You should arrange for your rwl program to handle such a condition.
removetempdir(dirname)
Call this function to remove the directory created by the maketempdir() function. Note that both the directory and its contents will be removed. If you do not call this procedure, the directory will be kept after execution, and unless its name is given to the user, it may be difficult to find.
makedir(dirname)
Create a directory with the name provided and return 0 if the creation is succesfull or if the directory already exists. If the directory could not be created, some non zero value will be returned.
copyfile(src,dst)
Copy a file from src to dst. The source must be an ordinary file and the destination must be either the name of a file or a directory.
Copyright
© 2024 Oracle Corporation
Licensed under the Universal Permissive License v 1.0 as
shown at https://oss.oracle.com/licenses/upl
include(1rwl), utilities(2rwl)