public void Open(string path, UVFileAccess access, Action <Exception> callback) { Ensure.ArgumentNotNull(callback, "path"); switch (access) { case UVFileAccess.Read: Readable = true; break; case UVFileAccess.Write: Writeable = true; break; case UVFileAccess.ReadWrite: Writeable = true; Readable = true; break; default: throw new ArgumentException("access not supported"); } UVFile.Open(Loop, path, access, (ex, file) => { uvfile = file; if (callback != null) { callback(ex); } }); }
public static void Open(Loop loop, string path, UVFileAccess access, Action<Exception, UVFile> callback) { var fsr = new FileSystemRequest(path); fsr.Callback = (ex) => { UVFile file = null; if (fsr.Result != IntPtr.Zero) { file = new UVFile(loop, fsr.Result.ToInt32()); } Ensure.Success(ex, callback, file); }; int r = uv_fs_open(loop.NativeHandle, fsr.Handle, path, (int)access, 0, FileSystemRequest.CallbackDelegate); Ensure.Success(r); }
public static void Open(Loop loop, string path, UVFileAccess access, Action <Exception, UVFile> callback) { var fsr = new FileSystemRequest(path); fsr.Callback = (ex) => { UVFile file = null; if (fsr.Result != IntPtr.Zero) { file = new UVFile(loop, fsr.Result.ToInt32()); } Ensure.Success(ex, callback, file); }; int r = uv_fs_open(loop.NativeHandle, fsr.Handle, path, (int)access, 0, FileSystemRequest.CallbackDelegate); Ensure.Success(r); }
public static void Open(Loop loop, string path, UVFileAccess access, Action <Exception, UVFile> callback) { var fsr = new FileSystemRequest(path); fsr.Callback = (ex) => { UVFile file = null; if (fsr.Result != IntPtr.Zero) { file = new UVFile(loop, fsr.Result); } if (callback != null) { callback(ex, file); } }; int r = uv_fs_open(loop.NativeHandle, fsr.Handle, path, (int)access, 0, FileSystemRequest.StaticEnd); Ensure.Success(r, loop); }
public static Task <UVFile?> Open(Loop loop, string path, UVFileAccess access) { return(HelperFunctions.Wrap <Loop, string, UVFileAccess, UVFile>(loop, path, access, UVFile.Open)); }
public static Task <UVFile?> Open(string path, UVFileAccess access) { return(Open(Loop.Constructor, path, access)); }
public static void Open(string path, UVFileAccess access, Action <Exception, UVFile> callback) { Open(Loop.Constructor, path, access, callback); }
public static void Open(string path, UVFileAccess access, Action<Exception, UVFile> callback) { Open(Loop.Default, path, access, callback); }
public static Task <UVFile> Open(Loop loop, string path, UVFileAccess access) { return(FWrap <UVFile, string, UVFileAccess>(loop, path, access, UVFile.Open)); }
public static Task <UVFile> Open(string path, UVFileAccess access) { return(Open(Loop.Default, path, access)); }
public static Task OpenAsync(this UVFileStream filestream, string path, UVFileAccess access) { return(HelperFunctions.Wrap(path, access, filestream.Open)); }
public static Task OpenAsync(this UVFileStream filestream, string path, UVFileAccess access) { return HelperFunctions.Wrap(path, access, filestream.Open); }
public void Open(string path, UVFileAccess access, Action<Exception> callback) { Ensure.ArgumentNotNull(callback, "path"); switch (access) { case UVFileAccess.Read: Readable = true; break; case UVFileAccess.Write: Writeable = true; break; default: throw new ArgumentException("access not supported"); } UVFile.Open(Loop, path, access, (ex, file) => { uvfile = file; if (callback != null) { callback(ex); } }); }
public static Task<UVFile> Open(Loop loop, string path, UVFileAccess access) { return HelperFunctions.Wrap<Loop, string, UVFileAccess, UVFile>(loop, path, access, UVFile.Open); }
public static Task<UVFile> Open(string path, UVFileAccess access) { return Open(Loop.Constructor, path, access); }
public static void Open(Loop loop, string path, UVFileAccess access, Action<Exception, UVFile> callback) { var fsr = new FileSystemRequest(path); fsr.Callback = (ex) => { UVFile file = null; if (fsr.Result != IntPtr.Zero) { file = new UVFile(loop, fsr.Result); } if (callback != null) { callback(ex, file); } }; int r = uv_fs_open(loop.NativeHandle, fsr.Handle, path, (int)access, 0, FileSystemRequest.StaticEnd); Ensure.Success(r, loop); }