Move drawers with same name

Discuss any general programming issues here
Post Reply
xabierpayet
Posts: 267
Joined: Fri Feb 24, 2012 9:34 am

Move drawers with same name

Post by xabierpayet »

is possible to move a drawer with files and subdrawers over another drawer containing another drawer with the same name,
to get the content of the 2 drawers in the same place? Movefile don´t write over a created drawer, and copyfile is very slow
for my purposes

example:

move----->dh0:mp3/
to--------> dh0:music/mp3

if i attemp to copy the dh0:mp3 drawer, to dh0:music/ drawer,hollywood don´t move any file
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: Move drawers with same name

Post by SamuraiCrow »

On Amiga-like OS's you can relocate a file without copying it using the Rename command. I don't know if Hollywood's behavior on all other platforms work that way but it's something you can try.
I'm on registered MorphOS using FlowStudio.
xabierpayet
Posts: 267
Joined: Fri Feb 24, 2012 9:34 am

Re: Move drawers with same name

Post by xabierpayet »

rename...
This function renames a file or a directory. oldname$ is the name of the file or directory to be renamed and can include a qualified path. newname$ is just the desired new name for the file/directory and must not contain a path specification.

This is not the solution, but thanks for the answer
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Move drawers with same name

Post by airsoftsoftwair »

Actually, I don't understand what the problem here is. What do you want to move where?
Severin
Posts: 18
Joined: Wed Oct 25, 2017 8:17 pm

Re: Move drawers with same name

Post by Severin »

xabierpayet wrote: Mon Apr 15, 2019 1:15 am example:

move----->dh0:mp3/
to--------> dh0:music/mp3
At a quick glance it looks like you have tried to copy the entire contents of a drawer to a single file called mp3

keep it simple:

movefile( dh0:mp3, dh0:music)
or
rename(dh0:mp3, dh0:music/mp3)

If you use /'s then you must use them on source and dest. This all assumes dh0:music/mp3 does not already exist. if it does then try something like:

For s$,t in DirectoryItems("dh0:mp3")
rename(s$, "dh0:music/mp3/" .. s$)
Next
Post Reply