To print the last modification time of the file foofile, use
print scalar localtime (stat("foofile"));
The unlink function returns
The number of files actually deleted
True or false, depending on success
The number of file deletions that were attempted
b or c. Choice b prints the time expressed as the number of seconds since 1970—not very useful. Choice c prints the time as a nicely formatted string.
a. However, choice b is also somewhat true. If no files can be deleted, unlink returns 0, which is false.
As a programming exercise only, try to write a program that lists all the files in a directory, in its subdirectories, and so on.
© 2000- NIV