A trap for the unwary Windows user:
When counting files in a directory using
set fileSYS=server.createObject("scripting.FileSystemObject"
set folderName = fileSYS.GetFolder("/temp" '(or wherever)
set allFiles = foldername.files
If there are (say) 10 files in the folder, allfiles.count returns a value of
12!
It had me confused for about a minute until I realised it must be counting
"." and ".." as files also - which makes sense as DOS treats them as files.
So the real number of files will be allfiles.count - 2
Steve Davis
hey.you@hahaha.com.au
When counting files in a directory using
set fileSYS=server.createObject("scripting.FileSystemObject"
set folderName = fileSYS.GetFolder("/temp" '(or wherever)
set allFiles = foldername.files
If there are (say) 10 files in the folder, allfiles.count returns a value of
12!
It had me confused for about a minute until I realised it must be counting
"." and ".." as files also - which makes sense as DOS treats them as files.
So the real number of files will be allfiles.count - 2
Steve Davis
hey.you@hahaha.com.au