Examples of gnatchop Usage (GNAT User’s Guide for Native Platforms)

#### 3.3.6.5 Examples of `gnatchop` Usage ¶

    $ gnatchop -w hello_s.ada prerelease/files

Chops the source file `hello_s.ada`. The output files are placed in the directory `prerelease/files`, overwriting any files with matching names in that directory (no files in the current directory are modified).

    $ gnatchop archive

Chops the source file `archive` into the current directory. One useful application of `gnatchop` is in sending sets of sources around, for example in email messages. The required sources are simply concatenated (for example, using a Unix `cat` command) and `gnatchop` is used at the other end to reconstitute the original files.

    $ gnatchop file1 file2 file3 direc

Chops all units in files `file1`, `file2`, `file3`, placing the resulting files in the directory `direc`. Note that if any units occur more than once anywhere within this set of files, `gnatchop` generates an error message, and doesn’t write any files. To override this check, use the `-w` switch, in which case the last occurrence in the last file will be the one that is output and `gnatchop` will skip earlier duplicate occurrences for the same unit.