Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? if isdir ....

Oct
358
2
Hello -- Does anyone know which win api function that this conditional uses in tcc? Thanks
 
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).
 
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.
 
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
 
Back
Top
[FOX] Ultimate Translator
Translate