public bool TryCreateDirectory(string path, bool createIntermediates, NSFileAttributes attributes) { NSError error; var dict = attributes == null ? null : attributes.ToDictionary(); return(TryCreateDirectory(path, createIntermediates, dict, out error)); }
public void SetAttributes(NSFileAttributes attributes, string path) { if (attributes == null) { throw new ArgumentNullException("attributes"); } SetAttributes(attributes.ToDictionary(), path); }
public bool TrySetAttributes(NSFileAttributes attributes, string path, out NSError error) { if (attributes == null) { throw new ArgumentNullException("attributes"); } return(TrySetAttributes(attributes.ToDictionary(), path, out error)); }
public bool SetAttributes(NSFileAttributes attributes, string path) { NSError ignore; if (attributes == null) { throw new ArgumentNullException("attributes"); } return(SetAttributes(attributes.ToDictionary(), path, out ignore)); }
public NSFileAttributes GetAttributes(string path) { NSError error; var result = NSFileAttributes.FromDict(_GetAttributes(path, out error)); if (result == null) { throw new NSErrorException(error); } return(result); }
internal static NSFileSystemAttributes FromDict(NSDictionary dict) { if (dict == null) { return(null); } var ret = new NSFileSystemAttributes(dict); ulong l = 0; uint i = 0; ret.Size = NSFileAttributes.fetch(dict, NSFileManager.SystemSize, ref l) ? l : 0; ret.FreeSize = NSFileAttributes.fetch(dict, NSFileManager.SystemFreeSize, ref l) ? l : 0; ret.Nodes = NSFileAttributes.fetch(dict, NSFileManager.SystemNodes, ref l) ? (long)l : 0; ret.FreeNodes = NSFileAttributes.fetch(dict, NSFileManager.SystemFreeNodes, ref l) ? (long)l : 0; ret.Number = NSFileAttributes.fetch(dict, NSFileManager.SystemFreeNodes, ref i) ? i : 0; return(ret); }
public bool CreateFile(string path, NSData data, NSFileAttributes attributes) { return CreateFile (path, data, attributes.ToDictionary ()); }
public bool CreateDirectory(string path, bool createIntermediates, NSFileAttributes attributes) { NSError error; return CreateDirectory (path, createIntermediates, attributes.ToDictionary (), out error); }
public static NSFileAttributes FromDict(NSDictionary dict) { if (dict == null) return null; var ret = new NSFileAttributes (); bool b = false; if (fetch (dict, NSFileManager.AppendOnly, ref b)) ret.AppendOnly = b; if (fetch (dict, NSFileManager.Busy, ref b)) ret.Busy = b; if (fetch (dict, NSFileManager.Immutable, ref b)) ret.Immutable = b; //if (fetch (dict, NSFileManager.ProtectedFile, ref b)) //ret.ProtectedFile = b; if (fetch (dict, NSFileManager.ExtensionHidden, ref b)) ret.FileExtensionHidden = b; var date = dict.ObjectForKey (NSFileManager.CreationDate) as NSDate; if (date != null) ret.CreationDate = date; date = dict.ObjectForKey (NSFileManager.ModificationDate) as NSDate; if (date != null) ret.ModificationDate = date; var name = dict.ObjectForKey (NSFileManager.OwnerAccountName) as NSString; if (name != null) ret.OwnerAccountName = name.ToString (); uint u = 0; if (fetch (dict, NSFileManager.DeviceIdentifier, ref u)) ret.DeviceIdentifier = u; if (fetch (dict, NSFileManager.GroupOwnerAccountID, ref u)) ret.FileGroupOwnerAccountID = u; if (fetch (dict, NSFileManager.OwnerAccountID, ref u)) ret.FileOwnerAccountID = u; if (fetch (dict, NSFileManager.HfsTypeCode, ref u)) ret.HfsTypeCode = u; if (fetch (dict, NSFileManager.PosixPermissions, ref u)) ret.PosixPermissions = u; if (fetch (dict, NSFileManager.ReferenceCount, ref u)) ret.FileReferenceCount = u; if (fetch (dict, NSFileManager.SystemFileNumber, ref u)) ret.FileSystemFileNumber = u; ulong l = 0; if (fetch (dict, NSFileManager.Size, ref l)) ret.FileSize = l; return ret; }
public NSFileAttributes TryGetAttributes(string path, out NSError error) { return(NSFileAttributes.FromDict(_GetAttributes(path, out error))); }
public bool CreateFile(string path, NSData data, NSFileAttributes attributes) { var dict = attributes == null ? null : attributes.ToDictionary(); return(CreateFile(path, data, dict)); }
public bool SetAttributes(NSFileAttributes attributes, string path) { NSError ignore; return(SetAttributes(attributes.ToDictionary(), path, out ignore)); }
public bool CreateFile (string path, NSData data, NSFileAttributes attributes) { var dict = attributes == null ? null : attributes.ToDictionary (); return CreateFile (path, data, dict); }
public bool SetAttributes (NSFileAttributes attributes, string path) { NSError ignore; if (attributes == null) throw new ArgumentNullException ("attributes"); return SetAttributes (attributes.ToDictionary (), path, out ignore); }
public static NSFileAttributes FromDict(NSDictionary dict) { if (dict == null) { return(null); } var ret = new NSFileAttributes(); bool b = false; if (fetch(dict, NSFileManager.AppendOnly, ref b)) { ret.AppendOnly = b; } if (fetch(dict, NSFileManager.Busy, ref b)) { ret.Busy = b; } if (fetch(dict, NSFileManager.Immutable, ref b)) { ret.Immutable = b; } //if (fetch (dict, NSFileManager.ProtectedFile, ref b)) //ret.ProtectedFile = b; if (fetch(dict, NSFileManager.ExtensionHidden, ref b)) { ret.FileExtensionHidden = b; } var date = dict.ObjectForKey(NSFileManager.CreationDate) as NSDate; if (date != null) { ret.CreationDate = date; } date = dict.ObjectForKey(NSFileManager.ModificationDate) as NSDate; if (date != null) { ret.ModificationDate = date; } var name = dict.ObjectForKey(NSFileManager.OwnerAccountName) as NSString; if (name != null) { ret.OwnerAccountName = name.ToString(); } uint u = 0; if (fetch(dict, NSFileManager.DeviceIdentifier, ref u)) { ret.DeviceIdentifier = u; } if (fetch(dict, NSFileManager.GroupOwnerAccountID, ref u)) { ret.FileGroupOwnerAccountID = u; } if (fetch(dict, NSFileManager.OwnerAccountID, ref u)) { ret.FileOwnerAccountID = u; } if (fetch(dict, NSFileManager.HfsTypeCode, ref u)) { ret.HfsTypeCode = u; } if (fetch(dict, NSFileManager.PosixPermissions, ref u)) { ret.PosixPermissions = u; } if (fetch(dict, NSFileManager.ReferenceCount, ref u)) { ret.FileReferenceCount = u; } if (fetch(dict, NSFileManager.SystemFileNumber, ref u)) { ret.FileSystemFileNumber = u; } ulong l = 0; if (fetch(dict, NSFileManager.Size, ref l)) { ret.FileSize = l; } return(ret); }
public NSFileAttributes GetAttributes(string path) { NSError error; return(NSFileAttributes.FromDict(_GetAttributes(path, out error))); }
public bool CreateFile(string path, NSData data, NSFileAttributes attributes) { return(CreateFile(path, data, attributes.ToDictionary())); }
public bool CreateDirectory(string path, bool createIntermediates, NSFileAttributes attributes) { NSError error; return(CreateDirectory(path, createIntermediates, attributes.ToDictionary(), out error)); }
public bool SetAttributes(NSFileAttributes attributes, string path, out NSError error) { return SetAttributes (attributes.ToDictionary (), path, out error); }
public bool CreateDirectory (string path, bool createIntermediates, NSFileAttributes attributes) { NSError error; var dict = attributes == null ? null : attributes.ToDictionary (); return CreateDirectory (path, createIntermediates, dict, out error); }
public bool SetAttributes(NSFileAttributes attributes, string path) { NSError ignore; return SetAttributes (attributes.ToDictionary (), path, out ignore); }
public bool SetAttributes(NSFileAttributes attributes, string path, out NSError error) { return(SetAttributes(attributes.ToDictionary(), path, out error)); }