示例#1
0
        /// <summary>
        /// Create all upfolders of A1 with, if they dont exist
        /// </summary>
        /// <param name="nad"></param>
        public static void CreateFoldersPsysicallyUnlessThere(string nad)
        {
            ThrowExceptions.IsNullOrEmpty(Exc.GetStackTrace(), type, "CreateFoldersPsysicallyUnlessThere", "nad", nad);
            ThrowExceptions.IsNotWindowsPathFormat(Exc.GetStackTrace(), type, Exc.CallingMethod(), "nad", nad);

            FS.MakeUncLongPath(ref nad);
            if (FS.ExistsDirectory(nad))
            {
                return;
            }
            else
            {
                List <string> slozkyKVytvoreni = new List <string>();
                slozkyKVytvoreni.Add(nad);

                while (true)
                {
                    nad = FS.GetDirectoryName(nad);

                    // TODO: Tady to nefunguje pro UWP/UAP apps protoze nemaji pristup k celemu disku. Zjistit co to je UWP/UAP/... a jak v nem ziskat/overit jakoukoliv slozku na disku
                    if (FS.ExistsDirectory(nad))
                    {
                        break;
                    }

                    string kopia = nad;
                    slozkyKVytvoreni.Add(kopia);
                }

                slozkyKVytvoreni.Reverse();
                foreach (string item in slozkyKVytvoreni)
                {
                    string folder = FS.MakeUncLongPath(item);
                    if (!FS.ExistsDirectory(folder))
                    {
                        Directory.CreateDirectory(folder);
                    }
                }
            }
        }
示例#2
0
 public static void CreateUpfoldersPsysicallyUnlessThere(string nad)
 {
     CreateFoldersPsysicallyUnlessThere(FS.GetDirectoryName(nad));
 }
示例#3
0
 public static List <string> GetFiles(string path, string v, SearchOption topDirectoryOnly)
 {
     return(FS.GetFilesMoreMasc(path, v, topDirectoryOnly).ToList());
 }