mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
bda0c935c2
This patch adds most of the plumbing for working file deletion in Ext2FS. Directory entries are removed and inode link counts updated. We don't yet update the inode or block bitmaps, I will do that separately.
18 lines
300 B
C++
18 lines
300 B
C++
#include <stdio.h>
|
|
#include <errno.h>
|
|
#include <unistd.h>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
if (argc != 2) {
|
|
fprintf(stderr, "usage: rm <path>\n");
|
|
return 1;
|
|
}
|
|
int rc = unlink(argv[1]);
|
|
if (rc < 0) {
|
|
perror("unlink");
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|
|
|