By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!Appears to be Kernel32.dll, GetFileAttributesW(). And FILE_ATTRIBUTE_DIRECTORY is 16 (0x10).Hello -- Does anyone know which win api function that this conditional uses in tcc? Thanks
Appears to be Kernel32.dll, GetFileAttributesW(). And FILE_ATTRIBUTE_DIRECTORY is 16 (0x10).
if %@eval[%@winapi[...] AND 16] == 16, it will be true.
You could get misleading results if you specify the name of something that doesn't exist. GetFileAttributesW will return -1 (0xFFFFFFFF). If you test that result like this
Code:if %@eval[%@winapi[...] AND 16] == 16, it will be true.
set rv=%@winapi[kernel32.dll,GetFileAttributesW,spec]
if %rv != -1 .AND. %@eval[%rv AND 16] == 16 echo It's a directory
http://msdn.microsoft.com/en-us/library/aa915578.aspx
I'd do something like this.
Code:set rv=%@winapi[kernel32.dll,GetFileAttributesW,spec] if %rv != -1 .AND. %@eval[%rv AND 16] == 16 echo It's a directory