Beispiel #1
0
 private void BeginSetWrite()
 {
     lock (_setLock) {
         var file = System.IO.Path.Combine(WorkingDirectory, "index.lst");
         _setFileHandle = System.IO.File.CreateText(file);
         _setWriter     = new NodeSystemLib2.FileFormats.RecordSetWriter(_setFileHandle);
         _setWriter.BeginWrite();
     }
 }
Beispiel #2
0
        public static void WriteToFile(RecordSet set, string path)
        {
            if (System.IO.File.Exists(path))
            {
                System.IO.File.Delete(path);
            }

            using (var writer = new RecordSetWriter(System.IO.File.CreateText(path))) {
                writer.BeginWrite();
                foreach (var record in set.Records)
                {
                    writer.BeginRecord();
                    foreach (var line in record.Lines)
                    {
                        writer.WriteRecordLine(line);
                    }
                    writer.EndRecord();
                }
                writer.EndWrite();
            }
        }