コード例 #1
0
ファイル: myfuse.c プロジェクト: junjieqian/Deduplicate-FUSE
// change the permission mode of the file
static int my_chmod(const char *path, mode_t mode)
{
	int res = 0;
	char fullpath[PATH_MAX];

	my_fullpath(fullpath, path);

	res = chmod(fullpath, mode);
	return res;
}
コード例 #2
0
ファイル: myfuse.c プロジェクト: junjieqian/Deduplicate-FUSE
// change the owner/group of the file
static int my_chown(const char *path, uid_t uid, gid_t gid)
{
	int res = 0;
	char fullpath[PATH_MAX];

	my_fullpath(fullpath, path);

	res = chown(fullpath, uid, gid);
	return res;
}
コード例 #3
0
ファイル: myfuse.c プロジェクト: junjieqian/Deduplicate-FUSE
// update the access/modifiy time of one file
static int my_utimes(const char *path, struct utimebuf *ubuffer)
{
	int res = 0;
	char fullpath[PATH_MAX];

	my_fullpath(fullpath, path);

	res = utime(fullpath, ubuffer);
	return res;
}
コード例 #4
0
ファイル: myfuse.c プロジェクト: junjieqian/Deduplicate-FUSE
// remove one file
static int my_unlink(const char *path)
{
	int res = 0;
	char fullpath[PATH_MAX];

	my_fullpath(fullpath, path);

	res = unlink(fullpath);
	return res;
}
コード例 #5
0
ファイル: myfuse.c プロジェクト: junjieqian/Deduplicate-FUSE
// delete directory
static int my_rmdir(const char *path)
{
	int res = 0;
	char fullpath[PATH_MAX];

	my_fullpath(fullpath, path);

	res = rmdir(fullpath);
	return res;
}
コード例 #6
0
ファイル: myfuse.c プロジェクト: junjieqian/Deduplicate-FUSE
// open directory
static int my_open(const char *path, struct fuse_file_info *file)
{
	int res = 0;
	char fullpath[PATH_MAX];

	my_fullpath(fullpath, path);

	res = open(fullpath, file->flags);

	return res;
}
コード例 #7
0
ファイル: myfuse.c プロジェクト: junjieqian/Deduplicate-FUSE
static int my_getattr(const char *path, struct stat *statbuf)
{
	int res = 0;
	char fullpath[PATH_MAX];

	my_fullpath(fullpath, path);

	res = lstat(fullpath, statbuf);

	return res;
}
コード例 #8
0
ファイル: myfuse.c プロジェクト: junjieqian/Deduplicate-FUSE
// create one file, using create syscall.
static int my_create(const char *path, mode_t mode, struct fuse_file_info *file)
{
	int res = 0;
	char fullpath[PATH_MAX];
	my_fullpath(fullpath, path);

	res = creat(fullpath, mode);
	file->fh = res;

	return res;
}
コード例 #9
0
ファイル: myfuse.c プロジェクト: junjieqian/Deduplicate-FUSE
// check the file access permissions, using the access() system call
static int my_access(const char *path, int mask)
{
	int res = 0;
	char fullpath[PATH_MAX];

	my_fullpath(fullpath, path);

	res = access(fullpath, mask);

	return res;
}
コード例 #10
0
ファイル: os2funcs.c プロジェクト: ErisBlastar/osfree
streng *os2_directory( tsd_t *TSD, cparamboxptr parms )
{
   streng *result=NULL ;
   int ok=HOOK_GO_ON ;
   char *path;

   checkparam(  parms,  0,  1 , "DIRECTORY" ) ;

   if (parms&&parms->value)
   {
      if (TSD->systeminfo->hooks & HOOK_MASK(HOOK_SETCWD))
         ok = hookup_output( TSD, HOOK_SETCWD, parms->value ) ;

      if (ok==HOOK_GO_ON)
      {
         path = str_of( TSD, parms->value ) ;
         if (chdir( path ) )
         {
            FreeTSD( path ) ;
            return nullstringptr() ;
         }
         FreeTSD( path ) ;
      }
   }

   /*
    * The remainder of this is for obtaining the current working directory...
    */
   if (TSD->systeminfo->hooks & HOOK_MASK(HOOK_GETCWD))
      ok = hookup_input( TSD, HOOK_GETCWD, &result ) ;

   if (ok==HOOK_GO_ON)
   {
      result = Str_makeTSD( REXX_PATH_MAX );
      my_fullpath( result->value, "." );
      result->len = strlen( result->value );
   }
   return result;
}