Jump to content
Sign in to follow this  
mik

How to differentiate a folder and a file?

Recommended Posts

mik

In windows explorer, many files and folders may be under the same folder, and with controllistview method, we can get many things of these files and folders. But How to differentiate a file and a folder? Does autoit provide some methods?

thank you!

Share this post


Link to post
Share on other sites
Zedna

Look at FileGetAttrib()

String returned could contain a combination of these letters "RASHNDOCT":

"R" = READONLY

"A" = ARCHIVE

"S" = SYSTEM

"H" = HIDDEN

"N" = NORMAL

"D" = DIRECTORY

"O" = OFFLINE

"C" = COMPRESSED (NTFS compression, not ZIP compression)

"T" = TEMPORARY

Share this post


Link to post
Share on other sites
mik

[quote name='Zedna' date='Sep 24 2007, 01:55 AM' post='408291']

Look at FileGetAttrib()

Share this post


Link to post
Share on other sites
ptrex

Share this post


Link to post
Share on other sites
lordofthestrings

how about this trick:

you have a folder c:\temp

in it you have files. you can use fileexists() to determine if a file exists

you always have the NUL File in every folder,

meaning that if you would want to verify if a folder exists, you can check for this file:

if fileexists("c:\temp\NUL") then ..


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×