zipcommand-line-interfacerarwinrar

How to use WinRar cli to pack files without including the whole folder structure


I'm trying to pack some files, including the parent folder these files are in, with Winrar, using cli.

The issue is that it's including all folders, starting from Users (in Windows), I don't want this. I only want the required folders, which in this case are:

as_qwe___031425_Simon
as_qwe___031425_Simon/VDB
as_qwe___031425_Simon/VDB/embergen_fire_a_0

And the files inside those folders.

What I'm getting is:

the structure I get

The command I'm using is f'"{winrar_path}" a -r -v10m "{dest_file}" @"{files_to_export_path}"' (from Python)

I've tried using ep1 and ep, this doesn't include any folders, so the result is a .rar with all the files, and no folders.

The text file that I use to define the files to pack contains absolute paths to these files:

C:\Users\Simon\Desktop\vdb\as_qwe___031425_Simon\vdb.blend
C:\Users\Simon\Desktop\vdb\as_qwe___031425_Simon\VDB\embergen_fire_a_0\embergen_fire_a_93.vdb

Thanks.


Solution

  • Make C:\Users\Simon\Desktop\vdb\ your current directory. Remove that string from your file with absolute paths to make them paths relative to your current directory. Then try again.