Jump to content
Sign in to follow this  
roman

Strange behavior of "FileDelete"?

Recommended Posts

roman

Hi

I want to delete a file, e.g. with Filename "abc" (no extension). If i use

FileDelete("c:\abc")

that works. But: if there exists a directoy c:\abc instead of a file, the same command deletes me the content of that directory(!)

How can i be sure to delete only a file, but never a directory (-content) with the same name?

Sure, i could use

FileDelete("c:\abc*")

but that deletes me all files, beginning with "abc...".

Greetings,

Roman.

Share this post


Link to post
Share on other sites
Markus

Try this:

FileDelete("D:\abc.*")

"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Share this post


Link to post
Share on other sites
roman

Try this:

FileDelete("D:\abc.*")
Hm.. Yes that works, but it deletes me the file "abc" with every extension, abc.txt, abc.doc and so on.

I want to by sure to touch only the file "abc". No more and not less.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.