Example #1
0
        public void DeleteFiles(List <FileStruct> fileList)
        {
            string[]          argv          = new string[1];
            List <FileStruct> localFileList = null;

            if (options.cvsExclude)
            {
                Exclude.AddCvsExcludes();
            }
            for (int j = 0; j < fileList.Count; j++)
            {
                if ((fileList[j].mode & Options.FLAG_TOP_DIR) == 0 || !Util.S_ISDIR(fileList[j].mode))
                {
                    continue;
                }
                argv[0] = options.dir + fileList[j].GetFullName();
                FileList fList = new FileList(options);
                if ((localFileList = fList.sendFileList(null, argv)) == null)
                {
                    continue;
                }
                for (int i = localFileList.Count - 1; i >= 0; i--)
                {
                    if (localFileList[i].baseName == null)
                    {
                        continue;
                    }
                    localFileList[i].dirName = localFileList[i].dirName.Substring(options.dir.Length);
                    if (FileList.fileListFind(fileList, (localFileList[i])) < 0)
                    {
                        localFileList[i].dirName = options.dir + localFileList[i].dirName;
                        deleteOne(localFileList[i].GetFullName(), Util.S_ISDIR(localFileList[i].mode));
                    }
                }
            }
        }
Example #2
0
        public void DeleteFiles(ArrayList fileList)
        {
            string[]  argv          = new string[1];
            ArrayList localFileList = null;

            if (options.cvsExclude)
            {
                Exclude.AddCvsExcludes();
            }
            for (int j = 0; j < fileList.Count; j++)
            {
                if ((((FileStruct)fileList[j]).mode & Options.FLAG_TOP_DIR) == 0 || !Util.S_ISDIR(((FileStruct)fileList[j]).mode))
                {
                    continue;
                }
                argv[0] = options.dir + ((FileStruct)fileList[j]).FNameTo();
                FileList fList = new FileList(options);
                if ((localFileList = fList.sendFileList(null, argv)) == null)
                {
                    continue;
                }
                for (int i = localFileList.Count - 1; i >= 0; i--)
                {
                    if (((FileStruct)localFileList[i]).baseName == null)
                    {
                        continue;
                    }
                    ((FileStruct)localFileList[i]).dirName = ((FileStruct)localFileList[i]).dirName.Substring(options.dir.Length);
                    if (FileList.fileListFind(fileList, ((FileStruct)localFileList[i])) < 0)
                    {
                        ((FileStruct)localFileList[i]).dirName = options.dir + ((FileStruct)localFileList[i]).dirName;
                        deleteOne(((FileStruct)localFileList[i]).FNameTo(), Util.S_ISDIR(((FileStruct)localFileList[i]).mode));
                    }
                }
            }
        }