1

I have few directories where I need to verify that these directories contain exact list of files and directories and if there are some files or directories more or less is should say so. The very essential thing is that available task is not enough for me because I need to know not just if all files exists, but also if there aren't some more which shouldn't be there.

I would like to do so with macrodef task where I could define list of files and directories (I have more of them, so macrodef seems to be the best solution), but I have a problem with checking for both types - directories and files at once. Any idea how to do so?

I didn't find any similar examples of macrodef and would appreciate all your help. Thanks

madleeen
  • 107
  • 1
  • 2
  • 8

2 Answers2

0

Use a present selector, see some examples for usage here :
https://stackoverflow.com/a/12847012/130683
https://stackoverflow.com/a/13316261/130683

Community
  • 1
  • 1
Rebse
  • 10,307
  • 2
  • 38
  • 66
  • Interesting, but isn't that more like for comparison of two folders or so? I don't want to compare more folders with each other. I want to check whether all folders contain what they are supposed to contain. – madleeen May 21 '13 at 14:29
  • Assumed you need to check several filestructures against some kind of reference, means checked folders should be similar, if not you'll get all files that don't match. Available will be no solution as it checks only for single file or dir. Another possible solution for your problem => see this question and answers => http://stackoverflow.com/q/5281612/130683 – Rebse May 22 '13 at 19:12
  • Thank you, I will check that. I actually don't have a problem with checking list of files or so, but the problem is when I need to check the list of mixed files and folders. And actually although I got some answers here I still have that problem. – madleeen May 23 '13 at 07:38
0

You can check if all files exist with available task, then count all the files on the given directory with resourcecount task. If it is equals to the number of files you expected, it is OK.

You'll need to set fileset and dirset for the Resource Collection.

Jean Waghetti
  • 4,711
  • 1
  • 18
  • 28