Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

remove - remove files

&pagelevel(4)&pagelevel

Syntax

#include <stdio.h>

int remove(const char *path); 

Description

remove() causes the file or empty directory named by the pathname pointed to by path to
be no longer accessible by that name. A subsequent attempt to open that file using that
name will fail, unless it is created anew.

remove() is identical to unlink() for files, and identical to rmdir() for directories.

BS2000
remove() can also be used for files with record I/O. (End)

Return val.

0

-1

if successful.

if an error occurs. errno is set to indicate the error.

Errors

Notes

See unlink() and rmdir().

The program environment determines whether remove() is executed for a BS2000 or
POSIX file.

BS2000
path can be a fully or partially qualified file name. If a partially qualified file name is specified,
remove() will delete all corresponding files without first asking for a (Y/N) confirmation. The
response "Y" is assumed.

remove() performs only a logical deletion of the file(s), i.e. the catalog entry is deleted, and
the assigned memory is released.

If a file has been opened by any program, it is not deleted. (End)

See also

rmdir(), unlink(), stdio.h.