-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage.h
More file actions
26 lines (22 loc) · 929 Bytes
/
storage.h
File metadata and controls
26 lines (22 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef NUFS_STORAGE_H
#define NUFS_STORAGE_H
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include "slist.h"
void storage_init(const char* path, int create);
int storage_stat(const char* path, struct stat* st);
int storage_read(const char* path, char* buf, size_t size, off_t offset);
int storage_write(const char* path, const char* buf, size_t size, off_t offset);
int storage_truncate(const char *path, off_t size);
int storage_mknod(const char* path, int mode);
int storage_unlink(const char* path);
int storage_link(const char *from, const char *to);
int storage_rename(const char *from, const char *to);
int storage_set_time(const char* path, const struct timespec ts[2]);
int storage_chmod(const char* path, mode_t mode);
slist* storage_list(const char* path);
char* get_dir_name(const char* path);
char* get_file_name(const char* path);
#endif