Copy/Move specific files to an identical folder structure

Hi all, wondering if anyone has any ideas which commands to start with that might meet the following goal:

I've got a music collection whose directoryand file structure follows -> Artist\Album\A■■■■.EXT. In each Album folder I've got two encoded versions of each song, an mp3 for listening and a monkey's audio for permanent archival to DVD.

What I'd like to is to create a button or context menu command that will let me move all of either file type (mp3 or ape, doesn't matter) to an identical folder structure somewhere else... say from e:\music to e:\backup; with the idea being that under the destination folder I want to retain all the Artist\Album folder structures and each file moved to it's correct folder.

Thoughts?
C'mon Nudel/JohnZ/Porc I know one of you guys are just itching to patch this one up :slight_smile:.

Just use a copy filter with Name Match *.mp3 or *.ape as appropriate, and start copying from the "Artist" level.

Hi Steje,

[quote]Thoughts?
C'mon Nudel/JohnZ/Porc I know one of you guys are just itching to patch this one up :slight_smile:.[/quote]

I'm working on a command line program to duplicate the partial folder structure between source and dest.
I still need a way to specify at what dir level to begin the replication of the partial structure.
At this point it only makes Dirs and does no file copies.

My program works, but results in the full sourcepath minus the drive:\ appended to the dest.
If it's just a different drive letter with some of the upper path the same, it results in the dir structure replicated after the identical dirnames.

It does work for long filenames.
It uses {sourcepath|noterm} and {destpath|noterm} as command line arguments.

It's really premature to release it, but if you'd like to talk about it, send me a private message.

I hve no formal C++ coursework. It's a total hack !
:opusicon: Porcupine

Ok well,

Jon, thanks - duh. I guess I overthought what I was trying to do, and plain old forgot about filters. Using the command Copy MOVE FILE E:\STAGE* TO E:\ARCHIVE FILTER monkey does the job of moving just the .APE files along with the relative folder structures from where I run the copy/move, but produces a sensible copy error when trying to remove the source folders per the 'MOVE' arg - since the .MP3 files are still in there and the folders aren't 'empty'. Any tricks to supress this?

Porc... thanks for hopping in as well but as per Jon's suggestion it seems like you too should be able to do the whole duplication of a folder structure maneuver right within Dopus with a simple copy command using a filter set for Type, Match, and [Folders Only]. Seems to work fine for me if all you want to do is copy a selected folder structure, but I'm not sure if that's where the goal of your proggy ends. It seems like might be aiming to put together something like what the Dopus Synchronize utility does? Wanna start another topic and hash that out?

Hi Steje !

I wasn't certain what you were attempting to do here.

I'm working with a photo archive that for the moment is still whole and intact.
In the interest of Drive space I'll have to move some of it to CD or DVD soon though.

These photos are read only.
However, I wish to have a Dir separate of them that also contains the photos I'm currently working on.
In your case it would be audio files.

I wasn't attempting to copy the entire recursive Dir paths.
All I'm attempting to do is copy some photos that exist in some deep Dir and retain the Dir structure that leads to them.
I don't wish to copy any other Dirs that may exist in the Dirs of its' path.

I'm attempting to choose a Dir level of the sourcepath to begin this copy.
That Dir level and down ( not recursive ) are then replicated in the destpath.

I'm perhaps a day or so away from finishing the program.
I need to add a third argument to the command line using for instance
{dlgstring|modify path without leaving a trailing \ |{sourcepath|noterm}} .
This tells the program to start making Dirs in the dest past the depth of the user modified {sourcepath|noterm} .

Well, if I'm really missing it with filters/synchonize we can discuss that.
I'm almost finished with the program.
I'll finish it and then we can hash it out either trashing it or whatever.
I'll start a new topic.
Any ideas on what to call the topic?

It's still good for me if we can kill it.
I've still learned something valuable ... huh?

:opusicon: Porcupine

Porcupine FWIW there's already a free command line tool out there that will do what you're trying to do.

It's called xxcopy.

For me the combination of DOpus, 4NT, and xxcopy lets me resolve any file management problem I may have pretty easily.

Hi John !

I'm looking forward to it .
Something good should surface here.

How's the weather in Iowa?
I camped at Geode in late March 2003 enroute to Blanchard Springs Caverns in Arkansas and then a tour of Louisiana.
I had the whole place to myself.
By coincidence, I took a route similar to yours in Louisiana.
Many of the Louisiana alligators I saw in the Sabine NWR, Mississippi drainage area were quite active and cutely wiggling down the "bayou".

Thank God we don't have any of those Aussie Crocs !

Bit colder this year. The lake is still breaking up.

:opusicon: Porcupine

Hey Porc, it seems like we're essentially trying to do the same thing for the same reason, just different file types. Yes, my current 'whole and intact' music folder is E:\Stage underneath which I've got various Artist\Album dir structures with both MP3 and APE versions of each track. Once I make sure all the tags are correct for both versions (I need to update the APE tags because I've encoded to APE manually) I then want to MOVE the APE files OUT of the E:\Stage folder structure to E:\Archive with all of the Artist\Album folder structures replicated. From there, I intend to write the archived/ape folder structure to DVD as I approach my 4.3GB DVD threshold.

The suggestion made by Jon 'works', but since the MOVE argument for the Copy command is trying to move/remove the source directories after the files are moved, and the dir's are not empty (the mp3's are still there) this part of the operation generates an error through which I must click on the Skip button for every directory in the source folder structure... not cool once I start trying to do this for a music collection consisting of 100 to 200 albums or so.

Hey JohnZ, with a hopefully clearer description of the sort of thing we're trying to achieve, do you still think the xxcopy proggy might fit the bill? Keep in mind, for disk space and speed reasons I don't actually want to 'copy' the files to the new archival location, just 'move' them.

Porc... for what it's worth you should be able to get to the same frustrating position I am in by defining your filter to be set for Attributes, Match, On: Read Only... :slight_smile:.

FYI, the Synchronize feature in Dopus would fit the bill perfectly (though would still require more than just clicking a button once to kick off since the active 'sync' feature isn't represented by an equivilant internal function/command) if it provided the option to 'move' the filtered files from the source to destination... but then I guess it would be more a 'migration' utility than a 'sync' utility eh?

Hmmm... looks like xxcopy is quite a cool utility JohnZ, but unfortunately it does indeed 'copy' the files to the dest, and then delete them from the source. This takes waaaaay longer than a regular move so I'd rather look for an actual migration tool... or maybe I can help with the proggy you're coming up with Porc...

Hi Steje,

Thanks for looking into this a bit more.
I really appreciate it.

I've started the process of integrating my third command line argument into my program.
I'll probably have a good working version Friday ( The weekend Australia time ) .

I'd prefer to send you a working copy of the exe file and the source before I post it.
That way, we can get an idea of what we have or don't have before we start posting on the Dopus Forum.

What I'm doing might not be what you're looking for as I'm only replicating the folder structure for a fixed path.
That is, I'm replicating the direct path from a dir level in sourcepath and making that dirpath in the dest minus any other dirs that might be in any dir in that path.

However, it could be part of the answer you're looking for.
If you have complex folder paths above various Album\Artist dirs and wish to retain that, my program could be part of the answer.
If you wish to disregard anything above the Album\Artist level and get it all in one recursive sweep, my program isn't the answer.

Can you tell me an email address ?

:opusicon: Porcupine

Hi Steje,

I'm very sorry, but after reading your last posts more carefully, I think we're attempting slightly different things.

I'll have to think on it some.

:opusicon: Porcupine

That seems like a bug which should be fixed, but you may be able to work around the problem by adding to your filter so that it doesn't match directories. That might make Opus only try to move the files (maybe with just one error for the top-level of the copy). That said, I'm not sure, since if you're matching *.mp3 then it should already not match directories...

Hey Nudel man... well I was hesitant to call it a bug because I am indeed performing the copy/move at a parent folder level, and if the include filter for .APE files were to then implicitly ignore the folder structures to prevent the 'move' of the occupied folder errors it seems that logic would also suggest I would NOT get the folder structures copied at all in the first place. And I do 'want' to get those artist and album folders 'copied' over to my destination...

my thoughts:

a) If an include filetype filter were to then implicitly ignore the copy of the folder structures, we could run an 'initial' copy of 'Folders Only' from my base source path to my base destination path. This however would imply some sort of additional option would then be needed to 'Preserve relative paths' or something like that for the Copy/Move function when run against just a particular file type as part of a filtered copy operating recursively down through a parent folder level.

b) The Copy/Move function could stay just the same as it is and benefit from an additional argument or option to 'Ignore errors on copy/move removal of non-empty folders' (the actual error in the message box is 145).

Either way, a change would be required in Dopus to get it to work the way I would really like and need it to. Otherwise my finger is going to get as sore as a furious Unreal fraggathon :slight_smile: since from his comment above Porc seems to be going a different way with his utility. Hey Porc, you should see my email from my member profile, you want to hash out the differences of what we're trying to do 'off-line'? Maybe we can collaborate on your proggy, or define exactly what's different about what we're doing and make a case for GP to make a change to help us out?

But Nudel, about your other suggestion... I had already tried adding a second clause to my 'monkey' filter to NOT MATCH Folders Only, and this resulted in nothing being copied at all. I believe this is due to the fact that my Copy command is starting from a base source path where ONLY directories are present, so the exclusion of folders causes the command to NOT recurse into the folders to look for the other file type in the filter (MATCH *.APE). If I placed some .APE files in that base source path, they sure enough would be copied/moved. Thanks though... any chance you might persuade GP to consider one of the options above :slight_smile: if you agree with the logic?

Hi Steje,

I'm sending you an email to that address.
As of today, I have a working version of what I was attempting.

I'll send the exe, source and button, as well as a debug version that outputs variable info and has a system pause in it.

:opusicon: porcupine

Cool Porc, I'll check it out over lunch and see what's what.

Don't forget the Skip All option in the error dialog. :slight_smile: Obviously not perfect because then you don't know about real errors, but might save your finger.

Wow Nudel, the sleep deprivation therapy my first born is subjecting mommy and me to must have addled my mind... between you and Jon I feel like a Dopus NEWB this week. Yes, the 'Skip All' is the ticket and my index finger feels better already :slight_smile:. Thanks for so tactfully pointing out the obvious...

While I still think some of the options discussed above might have some merit, this takes care of what I'm looking to do with a reasonable caveat. Porc and I have also worked out via email that we're trying to do slightly different things from a work pattern point of view... where I want to move all files of a certain type from a top level folder structure after having completed a lot of tag editing, and he wants to move bits and pieces as he finishes them and operate from 'within' the folder structure and recreate the higher level folders... which his proggy is doing at this point.