Jump to content

DirRemove() does not delete parent folder


DickG
 Share

Recommended Posts

C:\>md test
C:\>cd test
C:\test>rmdir .
Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird.
C:\test>cd ..
C:\>rmdir test
C:\>

You cannot delete the current directory

Edited by Exit

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

Does this mean that DirRemove() leaves the empty folder? The Help file says "Deletes a directory/folder." I didn't see anything that says it doesn't delete the specified folder. Now I'm confused. How do I delete the empty folder? Do I have to go to the folder's parent to delete it?

Link to comment
Share on other sites

  • Developers

This means that you are not able to delete a directory when a program has a file open or the has the directory set as its WorkingDirectory.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

OK, thanks. I found my problem. I didn't realize that @WorkingDir referred to the selected folder's parent.

If I select a file in a file manager (I use DOpus), then read $CMDLINERAW, it shows that folder's parent, rather than the selected folder (like I expected). Once I realized that, I was able to fix my code to handle that.

Thanks for your help.

Link to comment
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
 Share

  • Recently Browsing   0 members

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