Basic Solution File System - BSFS
Loading...
Searching...
No Matches
rm.c File Reference

Implements the rm command for the BSFS filesystem. More...

Classes

struct  rm_task_t
 Prepared removal record used by the bulk rm implementation. More...

Macros

#define PATH_MAX   4096

Functions

int rm (FILE *disk, superblock_t *sb, char **args)
 Remove a file (logical delete with Recovery snapshot).

Detailed Description

Implements the rm command for the BSFS filesystem.

Removes files from the filesystem.

Function Documentation

◆ rm()

int rm ( FILE * disk,
superblock_t * sb,
char ** args )

Remove a file (logical delete with Recovery snapshot).

Unlinks the directory entry and inserts a snapshot into the Recovery tree so the file can be restored later. Prints a confirmation or a concise error message (including permission denied when applicable).

Parameters
diskOpen filesystem image.
sbLoaded superblock.
argsCommand argv-like vector; expects target path in args[1].
Returns
1 to continue the browser loop.