Technical Documentation
For advanced users only.
CONTENTS:
- Command line switches supported by GSplit
- Using Batch text files and splitting multiple files
- Command line switches for GUnite
- Adding predefined values for piece size
1. Command line switches supported by GSplit
Section titled “1. Command line switches supported by GSplit”GSplit supports multiple command line switches.
What is a switch?
Section titled “What is a switch?”All switches are specified with a forward slash or a dash and are sometimes followed by a value. An example of a valid switch: "c:\program files\myfile.dat" /C
Please note that if you are specifying files or folders with spaces in them, you should enclose them in quotation marks.
The switches handled by GSplit
Section titled “The switches handled by GSplit”You may enter the switches like the following scheme:
GSPLIT.EXE "Param1" "Param2" "Param3" "Param 4"Param1: specify the full path to the file you would like to split. Can be left to blank if you have a configuration file or a batch file: just type "".Param2: lets you specify some optional commands.-go: starts splitting the file specified in "Param1" after having loaded the default configuration file. Optional.-c: this switch causes GSplit to load the profile file specified inParam3and then possibly split the associated file. Optional.-t: closes GSplit after having split the file. Optional.-b: reads the batch text file specified in "Param3". See below for further information about batch text files.-i: causes the batch text file to be executed: in fact,-bonly causes the batch text file to be read and-imakes GSplit split the source file(s).-s: activates the silent mode, GSplit works as a daemon, no GUI is displayed. Only if-ior-goare specified too.-l: saves the output log to the file specified in "Param 4".
Param3: (optional) the full path to the configuration or the batch file to be used.Param4: (optional) the full path to the output log file (-loption required).
GSplit exit codes:
Section titled “GSplit exit codes:”GSplit always returns an exit code when it closes. You can use this exit code in batch files to know whether a file was successfully split or not.
| Exit Code | Meaning |
|---|---|
| 0 | No error, file successfully split |
| 1 | Original file not found |
| 2 | Destination folder not specified |
| 3 | Error in settings (see log) |
| 4 | Error while splitting (see log) |
| 5 | Invalid command line parameters (invalid filenames or paths) |
Examples:
Section titled “Examples:”Split the MYPIC.EXE file:
GSPLIT.EXE "c:\my documents\mypic.exe" -goOpen the MYCONF.GSC profile to split MYPIC.EXE:
GSPLIT.EXE "c:\my documents\mypic.exe" -c "c:\my documents\myconf.gsc"Split the file according to the MYCONF.GSC profile silently (in background) and save the log file:
GSPLIT.EXE "" -c-go-s-t-l "c:\my documents\myconf.gsc" "c:\my documents\outputlog.rtf"Execute the specified batch file silently:
GSPLIT.EXE "" -b-i-s-t "c:\my documents\mybatch.txt"2. Using Batch text files and splitting multiple files
Section titled “2. Using Batch text files and splitting multiple files”Batch text files are normal text files (.txt) that contain instructions for GSplit in order to split one or more files. Batch files are useful for external applications which need to split files.
How do batch files work?
Section titled “How do batch files work?”Batch text files work like the old Windows configuration (.ini extension) files. They contain two sections "Main" and "FileList". The "Main" section is required.
Below you can see a simple example:
; GSplit Batch File; Pass these parameters to GSplit in order to run this file:; GSplit.exe "no" -b-i-t "[path to this file]"
[Main]ConfigFile=Source=c:\my programs\mymovie.aviDestFolder=d:\distribution\moviesPieSize=100PieSizeUnit=MBSplitMethod=0TypePieSpanned=0Title=My new movieThe different entries of [Main] are explained here:
ConfigFile: GSplit reads the configuration file specified by the value. Example:ConfigFile=c:\my documents\GSplit Config\myconfig1.gsfMulFiles: two values 1 or 0. 1 means that GSplit will have to split multiple files. And 0 means one file only. Optional (0 is the default value).DestFolder: the destination folder for the piece set.Source: ifMulFilesis set to 0, then this entry should point to the file to be split. Mandatory ifMulFilesis set to 0.TypePieSpanned: two values 1 or 0. 1 means that GSplit will create disk-spanned pieces, 0 means blocked pieces. Optional.SplitMethod: three values from 0 to 2. Only required ifTypePieSpannedis set to 0 (blocked pieces). Should be 0 if you set the size of the piece files, 1 if you specify the number of pieces you want to create or 2 if you want to split using occurrences of a pattern.PieSize: size of the blocked pieces (TypePieSpannedset to 0 ANDSplitMethodset to 0). Enter a real positive number. The unit is specified byPieSizeUnit.PieSizeUnit: the unit forPieSize. 4 values possible: Bytes, KB, MB and GB. By default this is "Bytes".PieNumber: number of blocked pieces to create (TypePieSpannedset to 0 ANDSplitMethodset to 1). Positive integer only.Pattern: the pattern used to split the file (TypePieSpannedset to 0 ANDSplitMethodset to 2).NumberOccurrences: defines the number of occurrences of the pattern by piece. Positive integer only.SplitBeforePattern: two values 1 or 0. 0 means GSplit splits after the nth occurrence of the pattern, 1 before.CustomHeader: three values from 0 to 2. 0: does nothing, 1: copies all data prior to the first occurrence or line, 2: insert the text specified byCustomHeaderText.CustomHeaderText: lets you enter the header you want, only required ifCustomHeaderis set to 2.Title: the title of the piece set (optional).Author: the author of the piece set (optional).Description: the description of the piece set (optional).PieMask: indicates the mask for piece filenames. Optional.NoPieHeader: two values 1 or 0. 1 means that GSplit won't add its tags to the piece files (useful for text-based files). And 0 means the default behavior (tags enabled). Optional.LogFile: full path to the splitting log to save when the operation is done. Optional.
If MulFiles is set to 1, then GSplit will need a second section called "FileList". This section lists all the files that will be split.
Files should be listed like this sample:
[FileList]0=c:\my documents\my music\aria.mp31=c:\my documents\my music\dream.mp32=c:\program files\my music reader\mp3pack.zip...Please refer to the "Splitting multiple files" help topic for further explanation about how GSplit can split several files in one time.
Below you can see a simple example working with multiple files:
; GSplit Batch File; Pass these parameters to GSplit in order to run this file:; GSplit.exe "no" -b-i-t "[path to this file]"
[Main]ConfigFile=MulFiles=1Source=DestFolder=a:\TypePieSpanned=1Title=My programs
[FileList]0=c:\my work\my programs\program1.exe1=c:\my work\my files\help1.chm3. Command line switches for GUnite
Section titled “3. Command line switches for GUnite”The switches handled by GUnite
Section titled “The switches handled by GUnite”You may enter the switches like the following scheme:
GUNITE.EXE [path to first piece] -u-v-m [output file] [buffer size][path to first piece]: specify the full path to the first piece file. Can be left to blank for memory options.Param2: lets you specify some optional commands.-u: unite pieces and exits.-v: opens the first piece and display the "Verify piece set" page. Incompatible with-u.-m: set the internal memory buffer's size (in kB). Optional.
[output file]: (optional) the full path to the future restored file. If not specified, you'll be prompted.[buffer size]: (optional) size for the internal buffer (in kB). Only required if-mis used.
GUnite exit codes:
Section titled “GUnite exit codes:”GUnite always returns an exit code when it closes. You can use this exit code in batch files to know whether a file was successfully restored or not.
| Exit Code | Meaning |
|---|---|
| 0 | No error, file successfully restored |
| 1 | Uniting not started or failed before completion |
| 2 | Uniting completed but file not correctly restored |
Examples:
Section titled “Examples:”Restore the testout.exe file and exit:
GUNITE.EXE "D:\GSplitPieces\disk1.gsd" -u "D:\testout.exe"Set the memory buffer's size to 128 kb.
GUNITE.EXE "" -m "" 1284. Adding predefined values for piece size
Section titled “4. Adding predefined values for piece size”If you create blocked pieces, you may have to enter a specific size for your pieces or choose a predefined value from the size list by clicking Predefined. GSplit reads all default values from a file called GDEFVAL.INF and available in the GSplit's main folder. This file is in text format and can be edited with Notepad. But it has its own syntax:
The first line (identification header) must be: "[GSplit Default Size Values]". Then follow the default values. One value per line.
To add a default value, you should use the following format:
NAME;DESCRIPTION;NUMBER OF BYTESwhere
- NAME is a general name like "1.44 MB"
- DESCRIPTION is an optional description like "3.5''HD". (enter None if no description).
- NUMBER OF BYTES is the final size that will be used if the end user selects this default value (positive integer, like 1457664).
This becomes: 1.44 MB;3.5''HD;1457664
