|
|
|||||||
Hello all I am starting a script to move some directories from one location on our server (Server 2000) to another and have run into a problem. The following code returns the File Attributes incorrectly. If I fill in the $Dir variable with a test directory that contains various files and directories the script does not seem to return the correct values. Any suggestions? code:All I need to do is to be able to distinguish a file from a directory. I tested this section of the script on Windows XP Home and got the incorrect values. Thanks in advance |
||||||||
|
|
|||||||
What do you mean by incorrect value? If GetFileAttrib($file) & 16 evaluates to '0' then it's a file, otherwise it's a directory. What values do you get? |
||||||||
|
|
|||||||
See also, the FAQ Topic: DIR() Primer |
||||||||
|
|
|||||||
it seems that line: $Attrib = GetFileAttr($File) & 16 is your reason. try with this: $Attrib = GetFileAttr($Dir+"\"+$File) & 16 |
||||||||
|
|
|||||||
Hello Lonkero Thanks for that. Its amazing how everything becomes clear when someone else points out the problem. Bye for now Kevin |