private void exportObject(RPakFile o, string path) { if (!o.IsDirectory) { System.IO.Stream S = o.Open(System.IO.FileAccess.Read); S.WriteToFile(path + "/" + o.Name); o.Close(); } else { System.IO.Directory.CreateDirectory(path + "/" + o.Name); foreach (RPakFile p in o.Children) exportObject(p, path + "/" + o.Name); } }
public void CloseFile(RPakFile f, Stream newStream) { newStream.Position = 0L; (f._Native as RisenPakFile).Invalidate(); Stream oldStream = (f._Native as RisenPakFile).OpenInNewStream(m_Stream, FileAccess.Read); bool same = oldStream.StreamsContentsAreEqual(newStream); oldStream.Close(); if (!same) { System.IO.Stream FS = FileManager.GetPhysicalFileLocation(f.Path).Open(FileAccess.Write); FS.Write(newStream.GetAllBytes(), 0, (int)newStream.Length); FS.Flush(); FS.Close(); } }
public Stream OpenFile(RPakFile f, FileAccess fA) { if (f._Native is RisenPakDirectory) return null; return (f._Native as RisenPakFile).OpenInNewStream(m_Stream, fA); }