public static IEnt FindReal(string name, MyDSI3 comm, ConDyn cd, IDir self) { MLoc m = MLoc.Ut.Get(self); TransmitRes res = comm.Transmit(new DSICommand().WithRequestPayload(new FPGetFileDirParms() .WithVolumeID(m.VolID) .WithDirectoryID(m.DirID) .WithFileBitmap(AfpFileBitmap.LongName | AfpFileBitmap.NodeID | (cd.ExtRW ? (AfpFileBitmap.ExtDataForkLength | AfpFileBitmap.ExtResourceForkLength) : AfpFileBitmap.DataForkLength | AfpFileBitmap.ResourceForkLength)) .WithDirectoryBitmap(AfpDirectoryBitmap.NodeID | AfpDirectoryBitmap.LongName) .WithPath(PUt.CombineRaw(m.RawPath, name)) )); if (res.pack.IsResponse && res.pack.ErrorCode == 0) { } else if (res.pack.ErrorCode == (int)AFPt2.DSIException.ResultCode.kFPObjectNotFound) { return null; } else throw new DSIException(res.pack.ErrorCode, res.pack); GetFileDirParmsPack pack = new GetFileDirParmsPack(res.br); FileParameters ent = pack.Parms; if (ent.IsDirectory) { return new MacDir(ent, comm, cd, self); } else { return new MacEnt(ent, Forkty.Data, comm, cd, self); } }
Stream GetFiSt(bool wr) { MLoc m = MLoc.Ut.Get(this); TransmitRes res1 = comm.Transmit(new DSICommand().WithRequestPayload(new FPGetFileDirParms() .WithVolumeID(m.VolID) .WithDirectoryID(m.DirID) .WithFileBitmap(AfpFileBitmap.FinderInfo) .WithPath(m.RawPath) )); if (res1.pack.IsResponse && res1.pack.ErrorCode == 0) { } else { throw new DSIException(res1.pack.ErrorCode, res1.pack); } GetFileDirParmsPack pack = new GetFileDirParmsPack(res1.br); return new MacFiSt(comm, pack.Parms.FinderInfo, m, wr); }