Ok, to complete the story for all for now ..

The simple solution was to change to:

 Code:
  if not ( getfileattr($SPath + $File) & 16 )        ; if file is not a dir.


A very D'oh moment for me as dir() of course returns only the name and not the path
_________________________