|
|
|||||||
How do I compare two arrays with files ? for example: 1 array contains files in a directory, the second files that should be there. How do I compare these ? |
||||||||
|
|
|||||||
Take a look at ASCAN() and loop through it with the smaller array. |
||||||||
|
|
|||||||
I presume you mean filenames and not the actual file contents. |
||||||||
|
|
|||||||
Sealeopard has pointed you in the right direction, but as this is starters here is an example to get you started (not tested). Assuming $asFilesInDir contains a list of all the files actually in the directory and $asFilesRequired contains a list of all the files that *should* be in the directory: code:This scriptlet will print a list of required files which are present, followed by a list of required files which are missing.For Each $sFile In $asFilesInDir The required file array is sacrificial - if you want to run it on more than one directory you will need to make a copy first. If you want to keep their status for using later, keep the status in an array which you maintain in parallel to the required files array. |
||||||||
|
|
|||||||
Thanx all, especially Jens !!! This is wat works for me : code:$allowedfiles = "1.tst","2.tst","3.tst" |