Jump to content

Recommended Posts

Posted

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??

Posted (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 by Mechaflash
  Reveal hidden contents

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...