Repository navigation
Expand file tree
/
Copy pathlink.c
More file actions
67 lines (49 loc) · 1.47 KB
/
Copy pathlink.c
File metadata and controls
67 lines (49 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
849F
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* Part of libhgfs - (c) 2009, D.C. van Moolenbroek */
#include "inc.h"
#include <sys/stat.h>
/*===========================================================================*
* hgfs_mkdir *
*===========================================================================*/
int hgfs_mkdir(const char *path, int mode)
{
/* Create a new directory.
*/
RPC_REQUEST(HGFS_REQ_MKDIR);
RPC_NEXT8 = HGFS_MODE_TO_PERM(mode);
path_put(path);
return rpc_query();
}
/*===========================================================================*
* hgfs_unlink *
*===========================================================================*/
int hgfs_unlink(const char *path)
{
/* Delete a file.
*/
RPC_REQUEST(HGFS_REQ_UNLINK);
path_put(path);
return rpc_query();
}
/*===========================================================================*
* hgfs_rmdir *
*===========================================================================*/
int hgfs_rmdir(const char *path)
{
/* Remove an empty directory.
*/
RPC_REQUEST(HGFS_REQ_RMDIR);
path_put(path);
return rpc_query();
}
/*===========================================================================*
* hgfs_rename *
*===========================================================================*/
int hgfs_rename(const char *opath, const char *npath)
{
/* Rename a file or directory.
*/
RPC_REQUEST(HGFS_REQ_RENAME);
path_put(opath);
path_put(npath);
return rpc_query();
}