Orthanc script zip command doesn't work for linux

Issue #674 resolved
Ed McDonagh created an issue

Because the path is quoted, the * will not be expanded and the command fails.

This command works:

local zip_executable = '/usr/bin/zip -r'

-- Zip the study files to save space and remove the originals after zipping
print('Zipping physics images: ' .. zip_executable .. ' "' .. temp_files_path .. '.zip"' .. ' "' .. temp_files_path .. dir_sep .. '"')
os.execute(zip_executable .. ' "' .. temp_files_path .. '.zip"' .. ' "' .. temp_files_path .. dir_sep .. '"')

i.e. I've removed the *.dcm at the end - the -r will recurse into the directory and scoop everything up.

Obviously we need it to continue to work for Windows.

@dplatten - can you advise?

Comments (10)

  1. David Platten

    @edmcdonagh, the -r switch also works for 7zip on Windows. So we can use your suggested os.execute, but with a Windows command like:

    local zip_executable = 'D:\\Server Apps\\7zip\\7za.exe a -r'
    
  2. Log in to comment