Delete Current directory

Hi,

I'm trying to enhance a button I already use, and I think it'll be handy for a lot of Dopus users.

I'll share in the button forum once it'll be done.

Its purpose is to delete the current directory and then go to the parent directory.

For instance : in the left lister, I'm in c:\temp\directory1
if I press the button, it'll delete "directory1" and then display the c:\temp.

I dit it with a simple command

Delete FILE .\ go UP

but the problem occurs when there are a lot of files in the directory, it's deleting in the background, at the same time I'm doing other stuffs and suddenly, the "go UP" command occurs.

So I tried to use a variable, but I think the problem is the {sourcepath$} remains as a string and isn't evaluate.
My button is :

@set dirname = {sourcepath$} go UP delete FILE {$dirname}

Any ideas ? :unamused:

Currently, you cannot set an Opus variable to the value of some Control Sequences, if the function type is an Internal command. I'm currently analyzing this issue to submit to GPSoftware (as an issue report or Feature Request). Some work and some do not, and it's a lot to test. But I will be submitting a very detailed report complete with test cases of Jon eventually. I'm kind of looking at all them, so it's taking me a while.

This seems to do the job:

Delete FILE={sourcepath$} Go Up

(I'm surprised it works since I thought the current directory would remain locked while the command ran, but it seems to work just fine as far as I can tell from testing it.)

yes, it works, but there is still the same issue : the "Go UP" command is executed once the directory is deleted, and this happens whatever you are doing. While it's deleting, if you decided to go to another directory and doing other stuff, you'll get the "Go UP" command, and once you are out of this directory, you do not need this command to be exectuted anymore.

This should fix that problem:

@async dopusrt /cmd Delete FILE={sourcepath$} Go Up

@async runs external commands in parallel with internal commands and dopusrt /cmd lets you run an external command which triggers an internal command. Combining the two lets you run a pair of internal commands in parallel. It's not pretty, but it's also rarely needed and better than not being able to do it at all. :slight_smile:

HAHA !!!! Perfect !!!!!

I tried to mess with the @async modifier, but I omitted the "dopusrt /cmd" in between...

Many thanks :smiley:

I'll put this button in the button section and some more (move current directory, copy current directory, delete current directory, rename current directory)

I found them very practical.