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

Implements chmod command for BSFS. More...

Functions

int chmod (FILE *disk, superblock_t *sb, char **args)
 Change permission bits of a path.

Detailed Description

Implements chmod command for BSFS.

Function Documentation

◆ chmod()

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

Change permission bits of a path.

Parses the octal mode and calls the high-level API to update permission bits. Prints usage on invalid input and a concise error on failure.

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