UNDELETE(2)
π UNDELETE(2) β System Calls Manual, but make it cute β¨
β¨ NAME β¨
undelete β attempt to recover a deleted file π«Ά
π LIBRARY π
Standard C Library (libc, -lc) β yes bestie, thatβs the one π
π§Ύ SYNOPSIS π§Ύ
#include <unistd.h>
int
undelete(const char *path);
π« DESCRIPTION π«
Okay so the undelete() system call attempts to recover the deleted file named by path. Thatβs the whole main-character mission πΈ.
Currently, this works only when the named object is a whiteout in a union file system. The system call removes the whiteout causing any objects in a lower layer of the union stack to become visible once more. Literally bringing the lower-layer vibes back into view π¦.
Eventually, the undelete() functionality may be expanded to other file systems able to recover deleted files such as the log-structured file system. Future icon behavior, no cap β¨.
π RETURN VALUES π
The undelete() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. Classic success/fail energy π
.
π ERRORS π
The undelete() succeeds unless one of these gremlins shows up:
[ENOTDIR]β A component of the path prefix is not a directory.[ENAMETOOLONG]β A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.[EEXIST]β The path does not reference a whiteout.[ENOENT]β The named whiteout does not exist.[EACCES]β Search permission is denied for a component of the path prefix.[EACCES]β Write permission is denied on the directory containing the name to be undeleted.[ELOOP]β Too many symbolic links were encountered in translating the pathname.[EPERM]β The directory containing the name is marked sticky, and the containing directory is not owned by the effective user ID.[EINVAL]β The last component of the path is β..β.[EIO]β An I/O error occurred while updating the directory entry.[EINTEGRITY]β Corrupted data was detected while reading from the file system.[EROFS]β The name resides on a read-only file system.[EFAULT]β Thepathargument points outside the process's allocated address space.
Yes, there are two [EACCES] entries β both are real, both matter, not me making it up π
π SEE ALSO π
Go peek, iykyk π§
πΈ HISTORY πΈ
The undelete() system call first appeared in 4.4BSD-Lite. Vintage but still iconic π₯.
xoxo, Debian π March 30, 2020 β UNDELETE(2) out. π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1994 Jan-Simon Pendry
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms