chapel-lang/chapel — pull request #192 by lydia-duncan (2014-08-22 15:29:50+00:00)
Title: Add ability to remove a file/directory

Add ability to remove a file or directory using Chapel code. This follows the same
strategy as the C remove function - it will complain if the file to be deleted does not
exist, or if the directory to be deleted is not empty.

Details:
modules/standard/IO.chpl: Adds two functions removeFile, one which throws an
ioerror if one occurred and one which merely returns the error via an out
argument to the function. Both take in the name of the file or directory to be
removed. While I was there, I checked my spelling.
runtime/include/qio/qio.h
runtime/src/qio/qio.c: Adds backend support for the removeFile function in the form
of qio_file_remove. This function calls the C function remove on the given
filename and returns a qioerr translation of any error that may have occurred.
Another comment spellcheck.
test/io/lydia/remove: Adds four tests of the functionality - removing a file and an
empty directory work as expected, removing a file that doesn't exist generates
an error, and removing a non-empty directory generates an error.
test/io/lydia/rename: Altered my preexec so that it sends errors to the .exec.out.tmp
file instead of detecting if one occurred and sending a generic error.