public static unsafe iPhoneFile Open(iPhone phone, string path, FileAccess openmode) { long num; OpenMode none = OpenMode.None; switch (openmode) { case FileAccess.Read: none = OpenMode.Read; break; case FileAccess.Write: none = OpenMode.Write; break; case FileAccess.ReadWrite: throw new NotImplementedException("Read+Write not (yet) implemented"); } string str = phone.FullPath(phone.GetCurrentDirectory(), path); int num2 = MobileDevice.AFCFileRefOpen(phone.AFCHandle, str, (int)none, 0, out num); if (num2 != 0) { throw new IOException("AFCFileRefOpen failed with error " + num2.ToString()); } return(new iPhoneFile(phone, num, none)); }
public static unsafe iPhoneFile Open(iPhone phone, string path, FileAccess openmode) { long num; OpenMode none = OpenMode.None; switch (openmode) { case FileAccess.Read: none = OpenMode.Read; break; case FileAccess.Write: none = OpenMode.Write; break; case FileAccess.ReadWrite: throw new NotImplementedException("Read+Write not (yet) implemented"); } string str = phone.FullPath(phone.GetCurrentDirectory(), path); int num2 = MobileDevice.AFCFileRefOpen(phone.AFCHandle, str, (int) none, 0, out num); if (num2 != 0) { throw new IOException("AFCFileRefOpen failed with error " + num2.ToString()); } return new iPhoneFile(phone, num, none); }