summaryrefslogtreecommitdiff
path: root/netfs/ice/volume.ice
blob: 7b0e3e0a856682bd847ef22d8314cd17eed6c4df (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef _VOLUME
#define _VOLUME

#include "exceptions.ice"
#include "types.ice"
#include "file.ice"
#include "directory.ice"

module NetFS {
	interface ReadOnlyVolume {
		void disconnect() throws AuthError;

		ReadOnlyFile * openReadOnly(ReqEnv env, string path, int flags) throws AuthError, SystemError;
		Directory * opendir(ReqEnv env, string path) throws AuthError, SystemError;

		idempotent VFS statfs(ReqEnv env, string path) throws AuthError, SystemError;
		idempotent int access(ReqEnv env, string path, int mode) throws AuthError, SystemError;
		idempotent Attr getattr(ReqEnv env, string path) throws AuthError, SystemError;
		idempotent string readlink(ReqEnv env, string path) throws AuthError, SystemError;
	};

	interface Volume extends ReadOnlyVolume {
		File * open(ReqEnv env, string path, int flags) throws AuthError, SystemError;
		File * create(ReqEnv env, string path, int flags, int mode) throws AuthError, SystemError;

		idempotent void truncate(ReqEnv env, string path, long size) throws AuthError, SystemError;
		void unlink(ReqEnv env, string path) throws AuthError, SystemError;

		void mkdir(ReqEnv env, string path, int mode) throws AuthError, SystemError;
		void rmdir(ReqEnv env, string path) throws AuthError, SystemError;

		void symlink(ReqEnv env, string path1, string path2) throws AuthError, SystemError;
		void link(ReqEnv env, string path1, string path2) throws AuthError, SystemError;
		void rename(ReqEnv env, string from, string to) throws AuthError, SystemError;
		idempotent void chmod(ReqEnv env, string path, int mode) throws AuthError, SystemError;
		idempotent void chown(ReqEnv env, string path, int uid, int gid) throws AuthError, SystemError;
		idempotent void utimens(ReqEnv env, string path, long atime, long atimens, long mtime, long mtimens) throws AuthError, SystemError;
	};
};

#endif