03514ba605
Patch submitted by hoefnix. Ref. https://groups.google.com/d/msg/minix-dev/sHQDVJRyx1c/eJjrYOqk5bgJ Change-Id: I2fcdf4cf119ef252ccc7df06849baf37ffd08440
67 lines
1.4 KiB
C
67 lines
1.4 KiB
C
/* Part of libhgfs - (c) 2009, D.C. van Moolenbroek */
|
|
|
|
#include "inc.h"
|
|
|
|
#include <sys/stat.h>
|
|
|
|
/*===========================================================================*
|
|
* hgfs_mkdir *
|
|
*===========================================================================*/
|
|
int hgfs_mkdir(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(char *path)
|
|
{
|
|
/* Delete a file.
|
|
*/
|
|
|
|
RPC_REQUEST(HGFS_REQ_UNLINK);
|
|
|
|
path_put(path);
|
|
|
|
return rpc_query();
|
|
}
|
|
|
|
/*===========================================================================*
|
|
* hgfs_rmdir *
|
|
*===========================================================================*/
|
|
int hgfs_rmdir(char *path)
|
|
{
|
|
/* Remove an empty directory.
|
|
*/
|
|
|
|
RPC_REQUEST(HGFS_REQ_RMDIR);
|
|
|
|
path_put(path);
|
|
|
|
return rpc_query();
|
|
}
|
|
|
|
/*===========================================================================*
|
|
* hgfs_rename *
|
|
*===========================================================================*/
|
|
int hgfs_rename(char *opath, char *npath)
|
|
{
|
|
/* Rename a file or directory.
|
|
*/
|
|
|
|
RPC_REQUEST(HGFS_REQ_RENAME);
|
|
|
|
path_put(opath);
|
|
path_put(npath);
|
|
|
|
return rpc_query();
|
|
}
|