Unable to Pass Selected File Collection to {allfile$}

I have a button/hot key that allows me to create a 7-Zip archive based on whatever files are selected in the active lister.

Today, I wanted to make an archive of all the *.jar files in a directory structure so I gathered them into a File Collection via Find. However, when I tried to send them to be added to the archive, it doesn't actually add them. Instead, it created an empty archive.

I didn't see anything in the documentation that specifically refers to File Collections and how they interact with external programs.

Of course, I could just be missing something completely obvious.

Any ideas?

Hi Randy,

There's nothing really special about the way file collections interact with external programs (since external programs don't actually know anything about file collections - it's just a list of files as far as the external program is concerned).

I suspect your problem is that {allfile$} does not pass the full pathname of selected files - only their filenames. Normally this works in Opus because the function's current directory is automatically set to the source folder, and so the external program is able to find the specified files using just their filenames.

However in the case of a file collection, which isn't a real folder on disk, you are going to need to provide the full pathnames of selected files to the external program, using {allfilepath$} instead.

I'm not sure this works either. The archiver comes back with a permissions issue that I know doesn't exist. I know that DOpus creates .col files that are text files that can be iterated but that seems like quite a few hoops to jump through just to manipulate a file collection with an external program.

I suggest you try the doptest utility on this site (in the Downloads / Tools section) - this will let you see exactly what command line Opus is producing. If it looks ok then the problem must lie with the archiver itself.

That's an excellent little utility. The command line looked proper enough. It works with {allfilepath$} which is good with the exception of when I want to store paths in the archive itself; with {allfilepath$} in a file collection, it's going to have a wide array of folders. To get around this, I'll probably just create a middle-button function that adds the flag to store folders for whenever I need it.

Thanks!