private Open ( int flags, int access, int attrs, int options ) : void | ||
flags | int | |
access | int | |
attrs | int | |
options | int | |
return | void |
internal virtual void Open(int flags, int access, int attrs, int options)
{
if (IsOpen())
{
return;
}
Fid = Open0(flags, access, attrs, options);
Opened = true;
TreeNum = Tree.TreeNum;
}
/// <exception cref="SharpCifs.Smb.SmbException"></exception> /// <exception cref="System.UriFormatException"></exception> /// <exception cref="UnknownHostException"></exception> public SmbRandomAccessFile(SmbFile file, string mode) { this._file = file; if (mode.Equals("r")) { _openFlags = SmbFile.OCreat | SmbFile.ORdonly; } else { if (mode.Equals("rw")) { _openFlags = SmbFile.OCreat | SmbFile.ORdwr | SmbFile.OAppend; _writeAndxResp = new SmbComWriteAndXResponse(); _options = WriteOptions; _access = SmbConstants.FileReadData | SmbConstants.FileWriteData; } else { throw new ArgumentException("Invalid mode"); } } file.Open(_openFlags, _access, SmbFile.AttrNormal, _options); _readSize = file.Tree.Session.transport.RcvBufSize - 70; _writeSize = file.Tree.Session.transport.SndBufSize - 70; _fp = 0L; }