File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,33 @@ format used by the host system; however it's also possible to explicitly
88
88
convert APE programs to any architectures / OS combination. For further
89
89
details on usage, run the ` assimilate -h ` command.
90
90
91
+
92
+ ## Binary archive format
93
+
94
+ The APE format includes another portability superpower: the ability to
95
+ distribute application support files WITHIN the compiled executable file.
96
+ This is because APE files are also mostly regular zip files! You will
97
+ need a copy of a compatible zip tool like the modified version of
98
+ Info-ZIP available here: https://cosmo.zip/pub/cosmos/bin/zip . With this
99
+ in hand the following command:
100
+
101
+ ``` sh
102
+ zip [APE file] [support_file.txt]
103
+ ```
104
+
105
+ adds support_file.txt to your executable. You can see it listed within
106
+ the archive with ` unzip -l [APE file] ` .
107
+
108
+ Cosmo libc includes compatible file handling functions for accessing the
109
+ contents of an APE file at the special '/zip' path. So your code is now
110
+ able to do the following:
111
+
112
+ ``` c
113
+ if (access( " /zip/support_file.txt" , F_OK) == 0 ) {
114
+ fprintf (stderr, "/zip/support_file.txt FOUND and can be used as an asset\n");
115
+ }
116
+ ```
117
+
91
118
## Gotchas
92
119
93
120
If you use zsh and have trouble running APE programs try ` sh -c ./prog `
You can’t perform that action at this time.
0 commit comments