Exemple #1
0
        private void SaveDirectories(string filePrefix)
        {
            var dirs = directories.ToJSON();

#if DEBUG
            GZfileIO.WriteStringToGZ($"{filePrefix}Files.Json", dirs);
#endif
            GZfileIO.WriteStringToGZ($"{filePrefix}Files.Json.gz", dirs);
        }
Exemple #2
0
        private void SaveACEs(string filePrefix)
        {
            var aces = _ACESet.ToJSON();

#if DEBUG
            GZfileIO.WriteStringToGZ($"{filePrefix}Aces.Json", aces);
#endif
            GZfileIO.WriteStringToGZ($"{filePrefix}Aces.Json.gz", aces);
        }
        public void Save()
        {
            var machine  = Environment.MachineName;
            var driveID  = _DiskName.Replace(Path.DirectorySeparatorChar.ToString(), "").Replace(":", "");
            var filePath = "DiskInventory";

            if (!Directory.Exists(filePath))
            {
                Directory.CreateDirectory(filePath);
            }
            var filePrefix = $"{filePath}{Path.DirectorySeparatorChar}{machine}_Disk_{driveID}_";
            {
                var acls = _ACLSet.ToJSON();
                GZfileIO.WriteStringToGZ($"{filePrefix}Acls.js", acls);
                GZfileIO.WriteStringToGZ($"{filePrefix}{ACLJsFileName}", acls);
            }
            {
                var dirs = directories.ToJSON();
                GZfileIO.WriteStringToGZ($"{filePrefix}Files.js", dirs);
                GZfileIO.WriteStringToGZ($"{filePrefix}{FileJsFileName}", dirs);
            }
        }