Discussion:
ANNOUNCE: cookbox 1.0.0
(too old to reply)
Konstantin Kushnir
2024-08-03 12:23:59 UTC
Permalink
Hi Everyone!

I'd like to announce a small example of practical use of the cookfs
package (https://github.com/chpock/cookfs) in applications.

Here is cookbox.

It is an utility to pack, unpack, view cookfs archives, and more...

The following examples are demonstrated in this utility:

* how to create a cookfs archive with Tcl runtime libraries/scripts and
application scripts during the build process
* how to use cookfs and build a single executable with Tcl interpreter,
Tcl runtime scripts, application scripts
* how to use cookfs from Tcl scripts to store data

The modes of packing, unpacking and viewing archives are similar to the
GNU tar utility and will most likely be very familiar to you. Tcl
hackers will be more interested in the additional modes:

Run interactive Tcl shell (-shell)
====

tclsh with TclReadLine is bundled and can be run interactively. For
example:

$ ./cookbox --shell
set tcl_patchLevel
9.0b3
puts "Hello world!"
Hello world!
exit
Evaluate the provided script or file (--eval)
====

Using this option it is possible to execute a Tcl script from the
command line or a file. For example:

$ ./cookbox --eval 'puts "Hello world!"'
Hello world!

or

$ cat script.tcl
puts "Hello World!"
$ ./cookbox --eval -f script.tcl
Hello World!

Wrap files to an executable (--cookinize)
====

Using this option, it is possible to make an executable file from a Tcl
script. Use the file name main.tcl as it is this file in the archive
that runs automatically at startup. For example:

$ cat main.tcl
puts "Hello World!"
$ ./cookbox --cookinize -f myapplication main.tcl
$ ./myapplication
Hello World!

Analyze an archive (--analyze)
====

Using this option it is possible to check the content of an archive.
For example, in this case cookbox will show its own content:

$ ./cookbox --analyze -f cookbox
<here is an output of coobox archive content>

Full examples with details, build instructions and binaries for
platforms Linux, Windows, MacOS are available on the corresponding
github page: https://github.com/chpock/cookbox

Please fill free to check/build/use it. Any feedback is welcome!
--
Best regards,
Konstantin Kushnir
Ashok
2024-08-05 11:42:13 UTC
Permalink
Quite impressive for what is only supposed to be a demo!

When using --cookinize with Tcl 9.0 does it replace the ZIP that Tcl 9
attaches to the executable/shared library with its own archive?

/Ashok
Post by Konstantin Kushnir
Hi Everyone!
I'd like to announce a small example of practical use of the cookfs
package (https://github.com/chpock/cookfs) in applications.
Here is cookbox.
It is an utility to pack, unpack, view cookfs archives, and more...
* how to create a cookfs archive with Tcl runtime libraries/scripts and
application scripts during the build process
* how to use cookfs and build a single executable with Tcl interpreter,
Tcl runtime scripts, application scripts
* how to use cookfs from Tcl scripts to store data
The modes of packing, unpacking and viewing archives are similar to the
GNU tar utility and will most likely be very familiar to you. Tcl
Run interactive Tcl shell (-shell)
====
tclsh with TclReadLine is bundled and can be run interactively. For
$ ./cookbox --shell
set tcl_patchLevel
9.0b3
puts "Hello world!"
Hello world!
exit
Evaluate the provided script or file (--eval)
====
Using this option it is possible to execute a Tcl script from the
$ ./cookbox --eval 'puts "Hello world!"'
Hello world!
or
$ cat script.tcl
puts "Hello World!"
$ ./cookbox --eval -f script.tcl
Hello World!
Wrap files to an executable (--cookinize)
====
Using this option, it is possible to make an executable file from a Tcl
script. Use the file name main.tcl as it is this file in the archive
$ cat main.tcl
puts "Hello World!"
$ ./cookbox --cookinize -f myapplication main.tcl
$ ./myapplication
Hello World!
Analyze an archive (--analyze)
====
Using this option it is possible to check the content of an archive.
$ ./cookbox --analyze -f cookbox
<here is an output of coobox archive content>
Full examples with details, build instructions and binaries for
platforms Linux, Windows, MacOS are available on the corresponding
github page: https://github.com/chpock/cookbox
Please fill free to check/build/use it. Any feedback is welcome!
Konstantin Kushnir
2024-08-05 21:46:13 UTC
Permalink
On Mon, 5 Aug 2024 17:12:13 +0530
Post by Ashok
Quite impressive for what is only supposed to be a demo!
Thank you!
Post by Ashok
When using --cookinize with Tcl 9.0 does it replace the ZIP that Tcl 9
attaches to the executable/shared library with its own archive?
Yes, it is actually one aspect of the demo - how to use cookfs package
and cookfs archive as storage for Tcl runtime files. It can be used
just like zipfs in Tcl9, but with much more features and flexibility.
--
Best regards,
Konstantin Kushnir
Loading...