Jump to content
Sign in to follow this  
MadBoy

Possible bug with *.* in Autoit?

Recommended Posts

MadBoy

I don't know if the hangover is giving me hard time or what but doing simple FileDelete(@tempdir & "\*.*") doesn't work while when i do FileDelete(@tempdir & "\*.nfs") or FileDelete(@tempdir & "\*.txt") it works fine deleting the files as needed. Also i tried to run the function below on the @tempdir and it didn't work. Maybe i'm missing something here so don't bash me for my hangover just yet but maybe there's something wrong with *.*.

Func _DirRemoveContents($folder)
    Local $search, $file
    If StringRight($folder, 1) <> "\" Then $folder = $folder & "\"
    If NOT FileExists($folder) Then Return 7
    FileDelete($folder & '*.*')
    $search = FileFindFirstFile($folder & "*")  ;// Find folders
    If $search = -1 Then Return 0
    While 1
        $file = FileFindNextFile($search)
        If @error Then ExitLoop
        If StringRight($file, 1) = "." Then ContinueLoop
        DirRemove($folder & $file, 1)
    WEnd
    Return FileClose($search)
EndFunc

Both newest beta and production version tested.

Edited by MadBoy

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites
Jos

I will speak softly :)

My guess is that there is a file in the @tempdir folder that cannot be deleted and the FileDelete() function stops and give an 0 returncode.

Did you check the returncode ?

and.... Why are you posting it here when you are not sure its a Bug?

thought it should be pretty clear that "Possible Bugs" questions must be posted in the Support forum untill its known there is a bug ...

Jos ;)


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
MadBoy

I will speak softly :)

My guess is that there is a file in the @tempdir folder that cannot be deleted and the FileDelete() function stops and give an 0 returncode.

Did you check the returncode ?

and.... Why are you posting it here when you are not sure its a Bug?

thought it should be pretty clear that "Possible Bugs" questions must be posted in the Support forum untill its known there is a bug ...

Jos ;)

Ye Jos, noticed this too late, wanted just post replay that "nevermind". Not being fresh at work kills me :P

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites
Jos

Ye Jos, noticed this too late, wanted just post replay that "nevermind". Not being fresh at work kills me ;)

np... moved to support ...:)

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  

×