Kidney Posted January 14, 2014 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??
saudumm Posted January 14, 2014 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
Mechaflash Posted January 14, 2014 Posted January 14, 2014 (edited) On 1/14/2014 at 11:25 AM, saudumm said: 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 Reveal hidden contents “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.”
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