Move drawers with same name

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

Move drawers with same name

Post by xabierpayet » Mon Apr 15, 2019 1:15 am

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: 208
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

Re: Move drawers with same name

Post by SamuraiCrow » Mon Apr 15, 2019 6:22 am

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.

xabierpayet
Posts: 176
Joined: Fri Feb 24, 2012 9:34 am

Re: Move drawers with same name

Post by xabierpayet » Tue Apr 16, 2019 12:08 am

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: 2968
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Move drawers with same name

Post by airsoftsoftwair » Tue Apr 30, 2019 8:37 pm

Actually, I don't understand what the problem here is. What do you want to move where?

Severin
Posts: 7
Joined: Wed Oct 25, 2017 8:17 pm

Re: Move drawers with same name

Post by Severin » Thu May 23, 2019 12:11 am

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