public void SetExtendedAttributes(string path, string name, byte[] value, XattrFlags flags) { if (Syscall.lsetxattr(path.GetPath(_source), name, value, (ulong)value.Length, flags) == -1) { throw new NativeException((int)Stdlib.GetLastError()); } }
public static Int32 FromXattrFlags(XattrFlags value) { Int32 rval; if (FromXattrFlags(value, out rval) == -1) { ThrowArgumentException(value); } return(rval); }
public override Errno OnSetPathExtendedAttribute( string path, string name, byte[] value, XattrFlags flags) { Trace.WriteLine($"OnSetPathExtendedAttribute Path:{path} Attribute:{value}"); int r = Syscall.setxattr(GetTargetPath(path), name, value, flags); if (r < 0) { return(GetLastError()); } return(0); }
private int _OnSetPathExtendedAttribute( string path, string name, byte[] value, ulong size, int flags) { Errno errno; try { XattrFlags f = NativeConvert.ToXattrFlags(flags); errno = _filesystem.OnSetPathExtendedAttribute(path, name, value, f); } catch (Exception e) { Trace.WriteLine(e.ToString()); errno = Errno.EIO; } return(Interop.ConvertErrno(errno)); }
public Result SetExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { return(ReadFile(path) .Then(file => { var attributes = file.ExtendedAttributes.Attributes; if (attributes.ContainsKey(name) && flags == XattrFlags.XATTR_CREATE) { return Result.Fail(FileSystemError.AlreadyExist); } if (!attributes.ContainsKey(name) && flags == XattrFlags.XATTR_REPLACE) { return Result.Fail(FileSystemError.NoAttribute); } attributes.Add(name, value); WriteFile(file); return Result.Ok(); })); }
private static int ToXattrFlags(Int32 value, out XattrFlags rval) { throw new System.NotImplementedException(); }
protected override Errno OnSetPathExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { int r = Syscall.lsetxattr (basedir+path, name, value, (ulong) value.Length, flags); if (r == -1) return Stdlib.GetLastError (); return 0; }
public virtual Errno OnSetPathExtendedAttribute( string path, string name, byte[] value, XattrFlags flags) { return(Errno.ENOSYS); }
private static extern int ToXattrFlags (Int32 value, out XattrFlags rval);
public static bool TryFromXattrFlags (XattrFlags value, out Int32 rval) { return FromXattrFlags (value, out rval) == 0; }
public static bool TryToXattrFlags(Int32 value, out XattrFlags rval) { return(ToXattrFlags(value, out rval) == 0); }
public static extern int fsetxattr (int fd, string name, byte[] value, ulong size, XattrFlags flags);
private static extern int FromXattrFlags(XattrFlags value, out Int32 rval);
protected override Errno OnSetPathExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { if (_umountToken == null) { return(Errno.EROFS); } if (path != "/.fuse_umount") { return(Errno.EROFS); } if (name != _umountToken) { return(Errno.EROFS); } if (value?.Length != 0) { return(Errno.EROFS); } _umountToken = null; Stop(); return(0); }
public Result SetPathExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { #if DEBUG var request = new CrazyFsRequest(CrazyFsRequestName.SetPathExtendedAttribute, new[] { new KeyValuePair <string, string>("path", path), new KeyValuePair <string, string>("name", name), new KeyValuePair <string, string>("flags", flags.ToString()) }).Log(); #endif try { FileSystem.Path.SetExtendedAttributes(path, name, value, flags); var result = new Result(ResultStatus.Success); #if DEBUG request.Log(result); #endif return(result); } catch (Exception ex) { var result = ex.GetResult(); #if DEBUG request.Log(result); #endif return(result); } }
public static int fsetxattr (int fd, string name, byte[] value, ulong size, XattrFlags flags) { throw new System.NotImplementedException(); }
public static int fsetxattr (int fd, string name, byte [] value, XattrFlags flags) { return fsetxattr (fd, name, value, (ulong) value.Length, flags); }
public static void SetExtendedAttributes(this IPath pathInterface, string path, string name, byte[] value, XattrFlags flags) { if (pathInterface is not ILinuxPath pathWrapper) { throw new Exception("IPath is not the linux version"); } pathWrapper.SetExtendedAttributes(path, name, value, flags); }
public static extern int lsetxattr (string path, string name, byte[] value, ulong size, XattrFlags flags);
public static int fsetxattr(int fd, string name, byte[] value, ulong size, XattrFlags flags) { throw new System.NotImplementedException(); }
public static int lsetxattr (string path, string name, byte [] value, XattrFlags flags) { return lsetxattr (path, name, value, (ulong) value.Length, flags); }
protected override Errno OnSetPathExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { Logging.Write (string.Format("(OnSetPathExtendedAttribute {0})", path)); if (path != "/hello") { return Errno.ENOSPC; } lock (hello_attrs) { hello_attrs [name] = value; } return 0; }
protected override Errno OnSetPathExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { return(0); }
public static bool TryFromXattrFlags(XattrFlags value, out Int32 rval) { return(FromXattrFlags(value, out rval) == 0); }
protected override Errno OnSetPathExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { int r = Syscall.lsetxattr(_basedir + path, name, value, (ulong)value.Length, flags); return(GetResult(r)); }
private static extern int ToXattrFlags(Int32 value, out XattrFlags rval);
protected override Errno OnSetPathExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { Logger.WriteLineIf(LogLevel.Verbose, _fslog_props, string.Format("OnSetPathExtendedAttribute, path={0}, name={1}, value={2}, flags={3}", path, name, Encoding.UTF8.GetString(value), flags)); return(this._rfs.SetPathExtendedAttribute(path, name, value, flags)); }
private static extern int FromXattrFlags (XattrFlags value, out Int32 rval);
protected override Errno OnSetPathExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { Trace.WriteLine("(OnSetPathExtendedAttribute {0})", path); if (path != hello_path) { return(Errno.ENOSPC); } lock (hello_attrs) { hello_attrs [name] = value; } return(0); }
public static Int32 FromXattrFlags (XattrFlags value) { Int32 rval; if (FromXattrFlags (value, out rval) == -1) ThrowArgumentException (value); return rval; }
protected override Errno OnSetPathExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { return(_fileSystem.SetPathExtendedAttribute(path, name, value, flags).ToErrno()); }
public static bool TryToXattrFlags (Int32 value, out XattrFlags rval) { return ToXattrFlags (value, out rval) == 0; }
private static int FromXattrFlags (XattrFlags value, out Int32 rval) { throw new System.NotImplementedException(); }
protected override Errno OnSetPathExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { return(WithLogging( () => fileSystemRepository.SetExtendedAttribute(path, name, value, flags), $"OnSetPathExtendedAttribute({path}, {name}, {flags})")); }
private static int ToXattrFlags (Int32 value, out XattrFlags rval) { throw new System.NotImplementedException(); }
private static int FromXattrFlags(XattrFlags value, out Int32 rval) { throw new System.NotImplementedException(); }
protected override Errno OnSetPathExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { if (path != writable_path) return Errno.ENOSPC; writable_attrs [name] = value; return 0; }
protected override Errno OnSetPathExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { Trace.WriteLine ("(OnSetPathExtendedAttribute {0})", path); if (path != hello_path) { return Errno.ENOSPC; } lock (hello_attrs) { hello_attrs [name] = value; } return 0; }
protected override Errno OnSetPathExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { Logger.WriteLineIf(LogLevel.Verbose, _fslog_props, string.Format("OnSetPathExtendedAttribute, path={0}, name={1}, value={2}, flags={3}", path, name, Encoding.UTF8.GetString(value), flags)); return this._rfs.SetPathExtendedAttribute(path, name, value, flags); }
protected override Errno OnSetPathExtendedAttribute(string path, string name, byte[] value, XattrFlags flags) { int r = Syscall.lsetxattr(basedir + path, name, value, (ulong)value.Length, flags); if (r == -1) { return(Stdlib.GetLastError()); } return(0); }
public static extern int fsetxattr (int fd, [MarshalAs (UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(FileNameMarshaler))] string name, byte[] value, ulong size, XattrFlags flags);