public FileStream(File file, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.IO.FileOptions options, int bufferSize, object creator) : base(file.ToString(), mode, access, share, bufferSize, options) { _file = file; _mode = mode; _access = access; _share = share; _options = options; _bufferSize = bufferSize; _creator = creator; _createdTimestamp = System.DateTime.Now; // Gets the calling method and stores it in _lastAccess - this is used to help resolve concurrent access request issues. _lastAccess = new StackTrace(true).GetFrame(1); FileSystem.Instance.RegisterHandle(this); }
public XNetworkStream(Socket socket, System.IO.FileAccess access, bool ownsSocket) : base(socket, access, ownsSocket) { }
public void StreamDataName(KSoft.IO.XmlElementStream s, FA mode, ref string name) { BCollectionXmlParams.StreamValue(s, mode, DataName, ref name, UseInnerTextForData, UseElementForData, InternDataNames, ToLowerDataNames); }
public override void StreamXml(KSoft.IO.XmlElementStream s, FA mode, XML.BXmlSerializerInterface xs) { s.StreamAttributeOpt(mode, kXmlAttrAttackRating, ref m_attackRating, Util.kNotFalsePredicate); s.StreamAttributeOpt(mode, kXmlAttrBaseType, ref m_baseType, Util.kNotFalsePredicate); s.StreamAttributeOpt(mode, kXmlAttrShielded, ref m_shielded, Util.kNotFalsePredicate); }
public void StreamXml(KSoft.IO.XmlElementStream s, FA mode, XML.BXmlSerializerInterface xs) { s.StreamElementOpt(mode, null, ref mXmlVersion, Util.kNotInvalidPredicate); SkullManager.StreamXml(s, mode, xs); }
public NetworkStream(System.Net.Sockets.Socket socket, System.IO.FileAccess access, bool ownsSocket) { }
public Descriptor(FSInputStream enclosingInstance, System.IO.FileInfo file, System.IO.FileAccess fileAccess) : base(new System.IO.FileStream(file.FullName, System.IO.FileMode.Open, fileAccess, System.IO.FileShare.ReadWrite)) { }
public SqlFileStream(string path, byte[] transactionContext, System.IO.FileAccess access, System.IO.FileOptions options, Int64 allocationSize) { }
public Descriptor(FSIndexInput enclosingInstance, System.IO.FileInfo file, System.IO.FileAccess mode) : base(new System.IO.FileStream(file.FullName, System.IO.FileMode.Open, mode, System.IO.FileShare.ReadWrite)) { InitBlock(enclosingInstance); }
public FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access) { ThrowHelper.ThrowIfNull(path); if ((int)access < 1 || (int)access > 3) { throw new System.ArgumentOutOfRangeException(); } switch (mode) { case System.IO.FileMode.CreateNew: CreateIfNotExist(); break; case System.IO.FileMode.Create: CreateOrTruncate(); break; case System.IO.FileMode.Open: OpenExisting(); break; case System.IO.FileMode.OpenOrCreate: OpenOrCreate(); break; case System.IO.FileMode.Truncate: TruncateExisting(); break; case System.IO.FileMode.Append: AppendOrCreate(); break; default: throw new System.ArgumentOutOfRangeException(); } void CreateIfNotExist() { // create a new file; throw IOException if exists if (access == System.IO.FileAccess.Read) { throw new System.ArgumentException(access.ToString()); } try { var stream = new java.io.RandomAccessFile(path, "r"); stream.close(); throw new System.IO.IOException("Exists: " + path); } catch (java.io.FileNotFoundException) { } JavaChannel = new java.io.RandomAccessFile(path, "rw").getChannel(); Flags = CAN_WRITE | CAN_SEEK; } void CreateOrTruncate() { // create a new file or truncate an existing file if (access == System.IO.FileAccess.Read) { throw new System.ArgumentException(access.ToString()); } var stream = new java.io.RandomAccessFile(path, "rw"); stream.setLength(0); JavaChannel = stream.getChannel(); Flags = CAN_WRITE | CAN_SEEK; } void OpenExisting() { // open existing file, throwing FileNotFoundException if cannot var stream = new java.io.RandomAccessFile(path, "r"); if (access != System.IO.FileAccess.Read) { // knowing the file exists, reopen for writing if necessary stream.close(); stream = new java.io.RandomAccessFile(path, "rw"); Flags = CAN_READ | CAN_WRITE | CAN_SEEK; } else { Flags = CAN_READ | CAN_SEEK; } JavaChannel = stream.getChannel(); } void OpenOrCreate() { // open existing file, or create a new file JavaChannel = new java.io.RandomAccessFile(path, "rw").getChannel(); if (access != System.IO.FileAccess.Read) { Flags = CAN_READ | CAN_WRITE | CAN_SEEK; } else { Flags = CAN_READ | CAN_SEEK; } } void TruncateExisting() { // truncate existing file, or throws FileNotFoundException if (access == System.IO.FileAccess.Read) { throw new System.ArgumentException(access.ToString()); } var stream = new java.io.RandomAccessFile(path, "r"); stream.close(); stream = new java.io.RandomAccessFile(path, "rw"); stream.setLength(0); JavaChannel = stream.getChannel(); Flags = CAN_WRITE | CAN_SEEK; } void AppendOrCreate() { var stream = new java.io.RandomAccessFile(path, "rw"); stream.seek(stream.length()); JavaChannel = stream.getChannel(); Flags = CAN_WRITE | CAN_SEEK; } }
public FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) : this(path, mode, access) { }
protected Package(System.IO.FileAccess openFileAccess) { }
protected override System.IO.Stream GetStreamCore(System.IO.FileMode streamFileMode, System.IO.FileAccess streamFileAccess) { return(default(System.IO.Stream)); }
protected abstract System.IO.Stream GetStreamCore(System.IO.FileMode mode, System.IO.FileAccess access);
public FileStream Open(FileMode mode, FileAccess access, FileShare share) { return File.Open(FullPath, mode, access, share, 4096, FileOptions.SequentialScan); }
public System.IO.Stream GetStream(System.IO.FileMode mode, System.IO.FileAccess access) { return(default(System.IO.Stream)); }
public static bool CanRead(this System.IO.FileAccess value) { return((value & System.IO.FileAccess.Read) != 0); }
/// <summary> /// Opens the specified access. /// </summary> /// <param name="access">The access.</param> /// <param name="sharing">The sharing.</param> /// <returns></returns> public abstract object Open(System.IO.FileAccess access, System.IO.FileShare sharing);
public static bool CanWrite(this System.IO.FileAccess value) { return((value & System.IO.FileAccess.Write) != 0); }
public NetworkStream(System.Net.Sockets.Socket socket, System.IO.FileAccess access) { }
public void StreamXml(KSoft.IO.XmlElementStream s, FA mode, XML.BXmlSerializerInterface xs) { Contract.Requires(s != null); Contract.Requires(mode != System.IO.FileAccess.ReadWrite); Contract.Requires(xs != null); }
public void StreamXml(KSoft.IO.XmlElementStream s, FA mode, XML.BXmlSerializerInterface xs) { XML.Util.Serialize(s, mode, xs, Skulls, BCollectibleSkull.kBListXmlParams); }
internal static System.IO.Stream Open(string name, System.IO.FileMode fileMode, System.IO.FileAccess fileAccess) { #if FIRST_PASS return(null); #else if (fileMode != System.IO.FileMode.Open || fileAccess != System.IO.FileAccess.Read) { throw new System.IO.IOException("vfs is read-only"); } VfsFile entry = GetVfsEntry(name) as VfsFile; if (entry == null) { throw new System.IO.FileNotFoundException("File not found"); } return(entry.Open()); #endif }
public void StreamXml(KSoft.IO.XmlElementStream s, FA mode, XML.BXmlSerializerInterface xs) { s.StreamCursorEnum(mode, ref mType); s.StreamAttributeEnumOpt(mode, kXmlAttrTarget, ref mTarget, e => e != BCollectibleSkullTarget.None); s.StreamAttributeOpt(mode, kXmlAttrValue, ref mValue, Util.kNotInvalidPredicateSingle); }
public static System.IO.FileStream Open(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) { throw null; }
public FileStream Open(FileMode mode, FileAccess access) { return(Open(mode, access, FileShare.None)); }
public System.IO.FileStream Open(System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) { throw null; }
public XNetworkStream(Socket socket, System.IO.FileAccess access) : base(socket, access) { }
public Task <Stream> OpenFileAsync(string path, FileMode mode, FileAccess access, FileShare share) { Stream stream = _isolatedStorageFile.OpenFile(path, mode, access, share); return(Task.FromResult(stream)); }
public FileStream Open(FileMode mode, FileAccess access) { return Open(mode, access, FileShare.None); }
/// <summary> /// Opens the IVfsNode and returns an object capable of doing something smart with the IVfsNode. /// </summary> /// <param name="access"></param> /// <param name="share"></param> /// <returns> /// An object instance, which represents the node. /// </returns> /// <remarks> /// This method is central to the entire VFS. It allows for interaction with filesystem entries in a way not possible /// with classical operating systems. The result of this function is heavily dependant on the item represented by the node, e.g. /// for a classic file (stream of bytes) the result of this method call would be a System.IO.Stream. For a device the result would /// be the driver object, for a directory it would be a System.IO.DirectoryInfo object, for kernel objects the respective object such /// as System.Threading.EventWaitHandle, System.Threading.Mutex, System.Threading.Thread, System.Diagnostics.Process etc. Note: The object /// retrieved can be closed by the respective methods on the returned object. There's no close functionality on the IVfsNode itself. /// </remarks> public override object Open(System.IO.FileAccess access, System.IO.FileShare share) { return(null); }
public SqlFileStream(string path, byte[] transactionContext, System.IO.FileAccess access) { }
public static System.IO.Packaging.Package Open(string path, System.IO.FileMode packageMode, System.IO.FileAccess packageAccess, System.IO.FileShare packageShare) { return(default(System.IO.Packaging.Package)); }