Beispiel #1
0
        //Create a new directory. If the directory exists then just return
        //an instance of it.
        public override Dir422 CreateDir(string dirName)
        {
            if (!CheckValidName(dirName))
            {
                return(null);
            }

            Dir422 newDir = null;

            if (Directory.Exists(_path + "/" + dirName))
            {
                newDir = GetDir(dirName);
            }
            else
            {
                try
                {
                    Directory.CreateDirectory(_path + "/" + dirName);
                    newDir = new StdFSDir(_path + "/" + dirName);
                }
                catch (Exception e)
                {
                    newDir = null;
                }
            }

            return(newDir);
        }
Beispiel #2
0
 //Set the root and return the filesystem object
 public static StandardFileSystem Create(string rootPath)
 {
     Root = new StdFSDir(rootPath);
     Root.SetRoot(true);
     return(new StandardFileSystem());
 }