public string[] Directory(string path) { string[] contents; using (XenStoreStringArray xenStoreDirectory = XenStoreFunctions.xs2_directory(this.xenStoreHandle, path)) { contents = xenStoreDirectory.Value; } return contents; }
public byte[] Read(string path) { byte[] read; using (XenStoreMemoryHandle mem = XenStoreFunctions.xs2_read(this.xenStoreHandle, path)) { read = mem.Value; } return read; }
protected override bool ReleaseHandle() { bool released = false; if (!this.IsInvalid) { System.IntPtr release = this.handle; this.handle = System.IntPtr.Zero; XenStoreFunctions.xs2_free(release); released = true; } return released; }
protected override bool ReleaseHandle() { // Seems like when disposing, IsClosed is true, even though we're in the middle of releasing... bool released = this.IsInvalid; if (!released) // If valid handle { System.IntPtr release = this.handle; this.handle = System.IntPtr.Zero; XenStoreFunctions.xs2_free(release); released = true; } // Ends if valid handle return released; }
public Microsoft.Win32.SafeHandles.SafeHandleMinusOneIsInvalid Watch(string path, Microsoft.Win32.SafeHandles.SafeWaitHandle event_) { XenStoreWatchHandle watch = XenStoreFunctions.xs2_watch(this.xenStoreHandle, path, event_); return watch; }
public bool Remove(string path) { return XenStoreFunctions.xs2_remove(this.xenStoreHandle, path); }
// Binary write path has been depricated // public bool Write(string path, byte[] data) // { // return XenStoreFunctions.xs2_write_bin(this.xenStoreHandle, path, data); // } public bool Write(string path, string data) { return XenStoreFunctions.xs2_write(this.xenStoreHandle, path, data); }
public bool Write(string path, byte[] data) { return(XenStoreFunctions.xs2_write_bin(this.xenStoreHandle, path, data)); }