[Dopus 11] Can Dopus search for files of specific type in subdirectories and archive them?

Hi,

I have been doing a lot of Python development recently.

I'd love to be able to setup a button in DOpus (11) that:

[ul]
[li] Searched for all *.py files in the current directory and all subdirectories of current directory[/li]
[li] Archived those files, keeping subdirectory folders intact, into a file called "Python_dev_files_20161025.zip" where the "20161025" component of the file name is automatically applied from today's date.[/li][/ul]

Can anyone tell me if this is possible in DOpus 11? Or, in DOpus 12, for that matter?

Many thanks,

pt

It is possible by using some lines of scripting code I'd say (applies to v11 and v12, what version do you use?).

  • use Find command to create collection of items (or seek through the folders yourself)
  • create the name of the file by using the DO date/time formatting object
  • use Copy ARCHIVE=keepfolder command on the items discovered and add them to the archive one by one

This might also work without scripting at all, not sure though.

Edit: Copy arguments corrected and it looks like, not so easy on the second glance!

I agree with tbone, and recommend the option of having the script enumerate and filter the files and folders itself, rather than using Find to create a collection.

There's an example here: Scripts (JS & VBS) Snippet: Enumerating files and metadata tags

You could also let 7-zip do the filtering:

"%programfiles%\7-Zip\7z.exe" a Python_dev_files_{date|yyyyMMdd}.zip {sourcepath}*.py -r

[quote="lxp"]You could also let 7-zip do the filtering:

"%programfiles%\7-Zip\7z.exe" a Python_dev_files_{date|yyyyMMdd}.zip {sourcepath}*.py -r

Thinking about it, if it's just *.py that you want, you could do the same with Opus's built-in copy filter (<-- Opus 11 version of the page; Opus 12 version). No need for scripting at all, nor external commands.

(Using an external command saves you having to define the filter, OTOH, so lxp's approach may still be easier if you already have 7z.exe installed.)

Works out of the box, but much more slowly:

SET FLATVIEW=mixednofolders,on SELECT *.py DESELECTNOMATCH COPY ARCHIVE CREATEFOLDER=Python_dev_files_{date|yyyyMMdd}.zip FLATVIEWCOPY=recreate SET FLATVIEW=off

Using Flat View for this would be quite slow indeed. Using the Copy Filter should be fast, on the other hand.