sofs19
0.1
FUSE based file system
|
Other system calls. More...
Functions | |
int | soOpenFileSystem (const char *devname) |
Open the sofs19 file system. More... | |
int | soCloseFileSystem (void) |
Close the sofs19 file system. More... | |
int | soStatFS (const char *path, struct statvfs *st) |
Get file system statistics. More... | |
int | soStat (const char *path, struct stat *st) |
Get file status. More... | |
int | soAccess (const char *path, int opRequested) |
Check real user's permissions for a file. More... | |
int | soChmod (const char *path, mode_t mode) |
Change permissions of a file. More... | |
int | soChown (const char *path, uid_t owner, gid_t group) |
Change the ownership of a file. More... | |
int | soUtime (const char *path, const struct utimbuf *times) |
Change the last access and modification times of a file. More... | |
int | soUtimens (const char *path, const struct timespec tv[2]) |
Change the last access and modification times of a file with nanosecond resolution. More... | |
int | soOpen (const char *path, int flags) |
Open a regular file. More... | |
int | soClose (const char *path) |
Close a regular file. More... | |
int | soFsync (const char *path) |
Synchronize a file's in-core state with storage device. More... | |
int | soOpendir (const char *path) |
Open a directory for reading. More... | |
int | soClosedir (const char *path) |
Close a directory. More... | |
Other system calls.
int sofs19::soOpenFileSystem | ( | const char * | devname | ) |
Open the sofs19 file system.
The rawdisk is open and, if it does not fail, the three dealers are open. This function is called by the mount operation.
devname | absolute path to the Linux file that simulates the storage device |
int sofs19::soCloseFileSystem | ( | void | ) |
Close the sofs19 file system.
The three dealers are closed and then the raw disk is closed. This function is called by the unmount operation.
int sofs19::soStatFS | ( | const char * | path, |
struct statvfs * | st | ||
) |
Get file system statistics.
It tries to emulate statvfs system call.
Information about a mounted file system is returned. It checks whether the calling process can access the file specified by the path.
To get more information, execute in a terminal the command man 2 statvfs
path | path to any file within the mounted file system |
st | pointer to a statvfs structure |
int sofs19::soStat | ( | const char * | path, |
struct stat * | st | ||
) |
Get file status.
It tries to emulate stat system call.
Information about a specific file is returned. It checks whether the calling process can access the file specified by the path.
To get more information, execute in a terminal the command man 2 stat
path | path to the file |
st | pointer to a stat structure |
int sofs19::soAccess | ( | const char * | path, |
int | opRequested | ||
) |
Check real user's permissions for a file.
It tries to emulate access system call.
It checks whether the calling process can access the file specified by the path for the requested operation.
To get more information, execute in a terminal the command man 2 access
path | path to the file |
opRequested | operation to be performed: F_OK (check if file exists) a bitwise combination of R_OK, W_OK, and X_OK |
int sofs19::soChmod | ( | const char * | path, |
mode_t | mode | ||
) |
Change permissions of a file.
It tries to emulate chmod system call.
It changes the permissions of a file specified by the path.
To get more information, execute in a terminal the command man 2 chmod
path | path to the file |
mode | permissions to be set: a bitwise combination of S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH |
int sofs19::soChown | ( | const char * | path, |
uid_t | owner, | ||
gid_t | group | ||
) |
Change the ownership of a file.
It tries to emulate chown system call.
It changes the ownership of the file specified by the path.
Only root may change the owner of a file. The file's owner may change the group if the specified group is one of the owner's supplementary groups.
To get more information, execute in a terminal the command man 2 chown
path | path to the file |
owner | file user id (-1, if user is not to be changed) |
group | file group id (-1, if group is not to be changed) |
int sofs19::soUtime | ( | const char * | path, |
const struct utimbuf * | times | ||
) |
Change the last access and modification times of a file.
It tries to emulate utime system call.
To get more information, execute in a terminal the command man 2 utime
path | path to the file |
times | pointer to a structure where the last access and modification times are passed, if NULL , the last access and modification times are set to the current time |
int sofs19::soUtimens | ( | const char * | path, |
const struct timespec | tv[2] | ||
) |
Change the last access and modification times of a file with nanosecond resolution.
It tries to emulate utimensat system call.
To get more information, execute in a terminal the command man 2 utimensat
path | path to the file |
tv | structure array where the last access, element of index 0, and modification, element of index 1, times are passed, if NULL , the last access and modification times are set to the current time if the tv_nsec field of one of the timespec structures has the special value UTIME_NOW , then the corresponding file timestamp is set to the current time if the tv_nsec field of one of the timespec structures has the special value UTIME_OMIT , then the corresponding file timestamp is left unchanged |
int sofs19::soOpen | ( | const char * | path, |
int | flags | ||
) |
Open a regular file.
It tries to emulate open system call.
In the current implementation it only checks if the calling process can access the file for the openning operation.
To get more information, execute in a terminal the command man 2 open
path | path to the file |
flags | access modes to be used: O_RDONLY, O_WRONLY, O_RDWR |
int sofs19::soClose | ( | const char * | path | ) |
Close a regular file.
It tries to emulate close system call.
To get more information, execute in a terminal the command man 2 close
path | path to the file |
int sofs19::soFsync | ( | const char * | path | ) |
Synchronize a file's in-core state with storage device.
It tries to emulate fsync system call.
To get more information, execute in a terminal the command man 2 fsync
path | path to the file |
int sofs19::soOpendir | ( | const char * | path | ) |
Open a directory for reading.
It tries to emulate opendir system call. In the current implementation it only checks if the calling process can access the file for the openning operation.
To get more information, execute in a terminal the command man opendir
path | path to the file |
int sofs19::soClosedir | ( | const char * | path | ) |
Close a directory.
It tries to emulate closedir system call.
To get more information, execute in a terminal the command man closedir
path | path to the file |