Ejemplo n.º 1
0
        /// <summary>
        /// Write func for the CWLS-format<para />
        /// For information on the format check the load/read func
        /// </summary>
        public static void write_recents(string file, IEnumerable <string> recents)
        {
            dbg("[CWLS]Writing file...");
            Stream fs = File.Open(file, Create, FileAccess.Write);

            fs.write(cwls_header);
            fs.WriteByte(5);
            dbg("[CWLS]Wrote header.");
            DeflateStream d = new DeflateStream(fs, CompressionLevel.Optimal, false);

            foreach (string r in recents)
            {
                d.write(utf8(r));
                d.WriteByte(11);
                dbg("[CWLS]Wrote \"" + r + "\".");
            }
            d.Close();
            dbg("[CWLS]Finished.");
        }