---
name: "rmobj"
section: "3"
platform: "linux"
package: "ltp-dev"
version: "20091231+dfsg-1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/rmobj"
---

# rmobj(3)

Remove a file, or a directory and all its subdirectories

## NAME

**rmobj** - Remove a file, or a directory and all its subdirectories

## SYNOPSIS

**int rmobj(***object***,** *errmsg***);**\
\
    **char \****object***;**\
\
    **char \*\****errmsg***;**\

## DESCRIPTION

The **rmobj** function will remove the specified object.  If the specified object is a directory, it will recursively remove the directory and everything underneath it.  **rmobj** assumes that it has the necessary privilege to remove whatever was specified.  If **rmobj** encounters any problems, and *errmsg* is not NULL, *errmsg* is set to point to a string explaining the error.

## RETURN VALUE

If **rmobj** encounters any problems, it will set *errmsg* (if it was not NULL) and return -1.  Otherwise it will return 0.

## SEE ALSO

**[rmdir(2)](/rmdir/2.md)**\
 **[unlink(2)](/unlink/2.md)**
