Recursive "move" command on MSX-DOS 2

By Louthrax

Prophet (2076)

Аватар пользователя 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

By sdsnatcher73

Hero (528)

Аватар пользователя 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.

By Grauw

Ascended (8365)

Аватар пользователя 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.

By Manuel

Ascended (15680)

Аватар пользователя Manuel

02-04-2019, 20:34

Did you try MVDIR?

By Grauw

Ascended (8365)

Аватар пользователя 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?

By Louthrax

Prophet (2076)

Аватар пользователя 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).

By Grauw

Ascended (8365)

Аватар пользователя 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?

By Louthrax

Prophet (2076)

Аватар пользователя 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.

By Grauw

Ascended (8365)

Аватар пользователя 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.