How to? if isdir ....

Oct 18, 2008
277
1
Hello -- Does anyone know which win api function that this conditional uses in tcc? Thanks
 
May 20, 2008
9,199
60
Syracuse, NY, USA
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).

There also exists Shlwapi.dll (BOOL) PathIsDirectory (W and A versions).
 
May 20, 2008
9,199
60
Syracuse, NY, USA
Appears to be Kernel32.dll, GetFileAttributesW(). And FILE_ATTRIBUTE_DIRECTORY is 16 (0x10).
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.
 
Oct 18, 2008
277
1
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.
Hello –

Thanks for the info –

I been using sugarsync and just updated to V2 ... I have app that using that call (GetFileAttributes) too, but when I test to see if the item specified is a dir in the new SS drive, it fails where the tcc “if isdir” works –

there is info in the doc for the win api func to test for 0xffff – which means the item does not exist

call you post the text to the winapi call – thx