Jump to content

7zip multiple volumes


Recommended Posts

Hello

I try to divide my archive in small (500k) pieces. Already I have:

#include <7zip.au3>

#include

#include



$hWnd = 0

$sArcName = "archive_file.7z"

$sFileName = "file_to_pack.7z"

$sHide = 0

$sCompress = 5

$sRecurse = 1

$sIncludeFile = 0

$sExcludeFile = 0

$sPassword = 0

$sSFX = 0

$sVolume = 0

$sWorkDir = 0



$retResult = _7ZipAdd($hWnd, $sArcName, $sFileName, $sHide, $sCompress, $sRecurse, $sIncludeFile, $sExcludeFile, $sPassword, $sSFX, $sVolume, $sWorkDir)

above script packs my file in one big "archive_file.7z" but when i try to set "$sVolume = 512k" scripts starts and ends with a second.

What form $sVolume should have?

Link to comment
Share on other sites

I couldn't find attach option so:

I'm using this part of 7zip.au3 file:

; #FUNCTION# ====================================================================================================================

; Name...........: _7ZipAdd

; Description ...: Adds files to archive

; Syntax.........: _7ZipAdd($hWnd, $sArcName, $sFileName[, $sHide = 0[, $sCompress = 5[, $sRecurse = 1[, $sIncludeFile = 0[, _

; $sExcludeFile = 0[, $sPassword = 0[, $sSFX = 0[, $sVolume = 0[, $sWorkDir = 0]]]]]]]]])

; Parameters ....: $hWnd - Handle to parent or owner window

; $sArcName - Archive file name

; $sFileName - File names to archive up

; $sHide - Use this switch if you want the CallBack function to be called

; $sCompress - Compress level 0-9

; $sRecurse - Recursion method: 0 - Disable recursion

; 1 - Enable recursion

; 2 - Enable recursion only for wildcard names

; $sIncludeFile - Include filenames, specifies filenames and wildcards or list file that specify processed files

; $sExcludeFile - Exclude filenames, specifies what filenames or (and) wildcards must be excluded from operation

; $sPassword - Specifies password

; $sSFX - Creates self extracting archive

[b]; $sVolume - Specifies volumes sizes[/b]

; $sWorkDir - Sets working directory for temporary base archive

; Return values .: Success - Returns the string with results

; Failure - Returns 0 and and sets the @error flag to 1

; Author ........: R. Gilman (rasim)

; ===============================================================================================================================

Func _7ZipAdd($hWnd, $sArcName, $sFileName, $sHide = 0, $sCompress = 5, $sRecurse = 1, $sIncludeFile = 0, $sExcludeFile = 0, _

$sPassword = 0, $sSFX = 0, $sVolume = 0, $sWorkDir = 0)



$sArcName = '"' & $sArcName & '"'

$sFileName = '"' & $sFileName & '"'



Local $iSwitch = ""



If $sHide Then $iSwitch &= " -hide"



$iSwitch &= " -mx" & $sCompress

$iSwitch &= _RecursionSet($sRecurse)



If $sIncludeFile Then $iSwitch &= _IncludeFileSet($sIncludeFile)

If $sExcludeFile Then $iSwitch &= _ExcludeFileSet($sExcludeFile)



If $sPassword Then $iSwitch &= " -p" & $sPassword



If FileExists($sSFX) Then $iSwitch &= " -sfx" & $sSFX



If $sVolume Then $iSwitch &= " -v" & $sVolume



If $sWorkDir Then $iSwitch &= " -w" & $sWorkDir



Local $tOutBuffer = DllStructCreate("char[32768]")



Local $aRet = DllCall($hDLL_7ZIP, "int", "SevenZip", _

"hwnd", $hWnd, _

"str", "a " & $sArcName & " " & $sFileName & " " & $iSwitch, _

"ptr", DllStructGetPtr($tOutBuffer), _

"int", DllStructGetSize($tOutBuffer))



If Not $aRet[0] Then Return SetError(0, 0, DllStructGetData($tOutBuffer, 1))

Return SetError(1, 0, 0)

EndFunc ;==>_7ZipAdd

I've bolded volmes size

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...