/** * Creates a new dir. * * @param path the path on the FS of the new dir * @param mode Dir creation flags (IGNORED) * @return 0 on success, a negative value on error */ @Override public int mkdir(String path, @mode_t long mode) { final AlluxioURI turi = mPathResolverCache.getUnchecked(path); LOG.trace("mkdir({}) [Alluxio: {}]", path, turi); try { mFileSystem.createDirectory(turi); } catch (Throwable t) { LOG.error("Failed to create directory {}", path, t); return AlluxioFuseUtils.getErrorCode(t); } return 0; }
public int create(String path, @mode_t long mode, FuseFileInfo fi) { final AlluxioURI uri = mPathResolverCache.getUnchecked(path); final int flags = fi.flags.get();
/** * Changes the mode of an Alluxio file. * * @param path the path of the file * @param mode the mode to change to * @return 0 on success, a negative value on error */ @Override public int chmod(String path, @mode_t long mode) { AlluxioURI uri = mPathResolverCache.getUnchecked(path); SetAttributePOptions options = SetAttributePOptions.newBuilder() .setMode(new alluxio.security.authorization.Mode((short) mode).toProto()).build(); try { mFileSystem.setAttribute(uri, options); } catch (Throwable t) { LOG.error("Failed to change {} to mode {}", path, mode, t); return AlluxioFuseUtils.getErrorCode(t); } return 0; }
/** * Change the permission bits of a file * * @param mode The argument mode specifies the permissions to use in case a new file * is created. @see ru.serce.jnrfuse.struct.FileStat flags */ int chmod(String path, @mode_t long mode);
/** * Create a directory * <p> * Note that the mode argument may not have the type specification * bits set, i.e. S_ISDIR(mode) can be false. To obtain the * correct directory type bits use mode|S_IFDIR * * @param mode The argument mode specifies the permissions to use in case a new file * is created. @see ru.serce.jnrfuse.struct.FileStat flags */ int mkdir(String path, @mode_t long mode);
/** * Create a directory * <p> * Note that the mode argument may not have the type specification * bits set, i.e. S_ISDIR(mode) can be false. To obtain the * correct directory type bits use mode|S_IFDIR * * @param mode The argument mode specifies the permissions to use in case a new file * is created. @see ru.serce.jnrfuse.struct.FileStat flags */ int mkdir(String path, @mode_t long mode);
/** * Change the permission bits of a file * * @param mode The argument mode specifies the permissions to use in case a new file * is created. @see ru.serce.jnrfuse.struct.FileStat flags */ int chmod(String path, @mode_t long mode);
/** * Create a file node * <p> * This is called for creation of all non-directory, non-symlink * nodes. If the filesystem defines a create() method, then for * regular files that will be called instead. * * @param mode The argument mode specifies the permissions to use in case a new file * is created. @see ru.serce.jnrfuse.struct.FileStat flags */ int mknod(String path, @mode_t long mode, @dev_t long rdev);
@Override @NotImplemented public int chmod(String path, @mode_t long mode) { return 0; }
/** * Create a file node * <p> * This is called for creation of all non-directory, non-symlink * nodes. If the filesystem defines a create() method, then for * regular files that will be called instead. * * @param mode The argument mode specifies the permissions to use in case a new file * is created. @see ru.serce.jnrfuse.struct.FileStat flags */ int mknod(String path, @mode_t long mode, @dev_t long rdev);
@Override @NotImplemented public int mkdir(String path, @mode_t long mode) { return 0; }
@Override @NotImplemented public int mkdir(String path, @mode_t long mode) { return 0; }
@Override @NotImplemented public int chmod(String path, @mode_t long mode) { return 0; }
@Override @NotImplemented public int create(String path, @mode_t long mode, FuseFileInfo fi) { return -ErrorCodes.ENOSYS(); }
@Override @NotImplemented public int create(String path, @mode_t long mode, FuseFileInfo fi) { return -ErrorCodes.ENOSYS(); }
@Override @NotImplemented public int mknod(String path, @mode_t long mode, @dev_t long rdev) { return create(path, mode, null); }
@Override @NotImplemented public int mknod(String path, @mode_t long mode, @dev_t long rdev) { return create(path, mode, null); }
@Override public int mkdir(String path, @mode_t long mode) { if (getPath(path) != null) { return -ErrorCodes.EEXIST(); } MemoryPath parent = getParentPath(path); if (parent instanceof MemoryDirectory) { ((MemoryDirectory) parent).mkdir(getLastComponent(path)); return 0; } return -ErrorCodes.ENOENT(); }
@Override public int create(String path, @mode_t long mode, FuseFileInfo fi) { if (getPath(path) != null) { return -ErrorCodes.EEXIST(); } MemoryPath parent = getParentPath(path); if (parent instanceof MemoryDirectory) { ((MemoryDirectory) parent).mkfile(getLastComponent(path)); return 0; } return -ErrorCodes.ENOENT(); }
@Override public int create(String path, @mode_t long mode, FuseFileInfo fi) { if (getPath(path) != null) { return -ErrorCodes.EEXIST(); } MemoryPath parent = getParentPath(path); if (parent instanceof MemoryDirectory) { ((MemoryDirectory) parent).mkfile(getLastComponent(path)); return 0; } return -ErrorCodes.ENOENT(); }