Kidney Posted January 14, 2014 Share Posted January 14, 2014 Im trying to find out how to tell if a a _FileListToArray entry is a file or folder without using flag 2. is there a function that checks the file type (or extention) of a file/folder?? Link to comment Share on other sites More sharing options...
saudumm Posted January 14, 2014 Share Posted January 14, 2014 (edited) From Example 3 for FileGetAttrib in the Help File. ; Check if the filepath is a directory/folder. Does not validate if the directory/folder exists. Func IsDir($sFilePath) Return StringInStr(FileGetAttrib($sFilePath), "D") > 0 EndFunc ;==>IsDir Edited January 14, 2014 by saudumm Link to comment Share on other sites More sharing options...
Mechaflash Posted January 14, 2014 Share Posted January 14, 2014 (edited) From Example 3 for FileGetAttrib in the Help File. ; Check if the filepath is a directory/folder. Does not validate if the directory/folder exists. Func IsDir($sFilePath) ;Return StringInStr(FileGetAttrib($sFilePath), "D") > 0 Return StringInStr(FileGetAttrib($sFilePath), "D") ; removed the '> 0' EndFunc ;==>IsDir I would add a line to check the output of FileGetAttrib() so you don't get a false positive/negative from StringInStr() Edited January 14, 2014 by Mechaflash Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now