• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

AutoIT Is Dir Empty? (function)

Status
Not open for further replies.

DDoSer

The Real DDoSer
User
Joined
Oct 9, 2013
Messages
352
Reputation
0
Reaction score
4,578
Points
243
Credits
0
‎11 Years of Service‎
51%
[HIDE-THANKS]

Code:
>$IsEmpty = _DirIsEmpty("c:\Temp")

MsgBox(64, "Results", "$IsEmpty = " & $IsEmpty & @LF & "@error = " & @error)

Func _DirIsEmpty($sPath)
   If Not StringInStr(FileGetAttrib($sPath), "D") Then Return SetError(1, 0, 0)

   Local $hSearch = FileFindFirstFile($sPath & "\*")

   Local $iRet = @error

   FileClose($hSearch)

   Return $iRet
EndFunc
[/HIDE-THANKS]

 
Status
Not open for further replies.
Back
Top