Recursive "move" command on MSX-DOS 2

Par Louthrax

Prophet (2436)

Portrait de Louthrax

02-04-2019, 19:38

Hi all,

I'm wondering if there's a way to move a whole directory (and all it's sub-directories and files) from one place to another in MSX-DOS2? The "MOVE" command does not seem to work (and only handles files).

I'm currently planning to add a "Cut" option in SofaRun (and was thinking to delegate the execution of that command to an existing command or tool). But if nothing exists I'll try to code it from scratch...

!login ou Inscrivez-vous pour poster

Par sdsnatcher73

Prophet (3838)

Portrait de sdsnatcher73

02-04-2019, 20:26

I guess if you have to develop it (if it does not exist), it would be nice if it was (also) available as an external tool to use from DOS directly.

Par Grauw

Ascended (10699)

Portrait de Grauw

02-04-2019, 20:30

That’s a little disappointing… Nextor feature request? Should be a trivial operation for the OS, like moving a file, and much quicker than manually moving directory trees file by file… Surprised it doesn’t work already, not even sure why the BDOS code would prohibit it…

Btw, could also be interesting to use for a directory sort utility.

Par Manuel

Ascended (19273)

Portrait de Manuel

02-04-2019, 20:34

Did you try MVDIR?

Par Grauw

Ascended (10699)

Portrait de Grauw

02-04-2019, 20:57

http://map.grauw.nl/resources/dos2_functioncalls.php#_MOVE

The function call is called “MOVE FILE OR SUBDIRECTORY”, and the description also clearly includes directories… So it really should work. Are you sure that it doesn’t?

What error code does it return?

Par Louthrax

Prophet (2436)

Portrait de Louthrax

02-04-2019, 20:52

Thanks guys for the informations here, I'll try them. If MVDIR does not work, I'll integrate that functionality into SofaCopy (SC.COM), that little tools that already performs the Copy/Paste operations for SofaRun (have not promoted it or distributed this tool in a separate package yet).

Par Grauw

Ascended (10699)

Portrait de Grauw

02-04-2019, 20:58

I think perhaps the source path should not include a trailing \, and the destination path should. Maybe that’s the issue? Have you tried using a FIB instead of a path string?

Par Louthrax

Prophet (2436)

Portrait de Louthrax

02-04-2019, 22:08

Yes, it works perfectly by calling the MVDIR command and using Gauw"s slashing recommendations Smile
I'll try DOS2 MOVE command (might be faster)...

EDIT: It also works with the DOS2 0x4F MOVE command. Moving a 200MB+ directory only takes 1s Smile (yeah, I know how the file system works... but still, that makes me happy !). Have not tried if moving from one drive to another drive works.

Par Grauw

Ascended (10699)

Portrait de Grauw

02-04-2019, 22:49

Louthrax wrote:

It also works with the DOS2 0x4F MOVE command. Moving a 200MB+ directory only takes 1s Smile

Good to hear!

Louthrax wrote:

Have not tried if moving from one drive to another drive works.

Doubt that… Need to XCOPY + DELTREE for that I think.