[Top] [Prev] [Next] [Bottom]


[Contents] [Index]

remove - remove a file

remove: fn(file: string): int;
## returns 0 if file is deleted, -1 otherwise.

Description

The remove function removes file from the directory containing it. The contents of the file are discarded. The user must have write permission in the containing directory.

The file argument can be a directory. If so, it must be empty for remove to succeed.

The remove function returns zero if it deletes the file, -1 otherwise.

Example

This example tries to remove the file represented by afile.

if(sys->remove(afile) == -1){
	sys->fprint(stderr, "mv: can't remove %s\n", afile);


[Top] [Prev] [Next] [Bottom]

infernosupport@lucent.com
Copyright © 1997, Lucent Technologies, Inc.. All rights reserved.