Re: [Pharo-project] image format with shebang

2012-10-16 Thread Camillo Bruni
On 2012-10-16, at 14:49, Damien Cassou damien.cas...@gmail.com wrote: On Sat, Oct 13, 2012 at 10:51 PM, Camillo Bruni camillobr...@gmail.com wrote: It is supported, see for instance: http://marc.info/?l=squeak-vm-devm=124049248310307w=2 awesome! strange that nobody promoted that so far...

Re: [Pharo-project] image format with shebang

2012-10-16 Thread Sven Van Caekenberghe
I understand that it would be nice eventually to have images saved like that automatically. It is still a pity that the VM has to change for that ;-) But as far as I understood, the first 512 bytes are skipped today as well, so if you (or any program) does a binary edit of the image header, it

Re: [Pharo-project] image format with shebang

2012-10-16 Thread Camillo Bruni
On 2012-10-16, at 15:08, Sven Van Caekenberghe s...@stfx.eu wrote: I understand that it would be nice eventually to have images saved like that automatically. It is still a pity that the VM has to change for that ;-) But as far as I understood, the first 512 bytes are skipped today as

Re: [Pharo-project] image format with shebang

2012-10-16 Thread Sven Van Caekenberghe
On 16 Oct 2012, at 15:17, Camillo Bruni camillobr...@gmail.com wrote: On 2012-10-16, at 15:08, Sven Van Caekenberghe s...@stfx.eu wrote: I understand that it would be nice eventually to have images saved like that automatically. It is still a pity that the VM has to change for that ;-)

Re: [Pharo-project] image format with shebang

2012-10-16 Thread Camillo Bruni
On 2012-10-16, at 15:30, Sven Van Caekenberghe s...@stfx.eu wrote: On 16 Oct 2012, at 15:17, Camillo Bruni camillobr...@gmail.com wrote: On 2012-10-16, at 15:08, Sven Van Caekenberghe s...@stfx.eu wrote: I understand that it would be nice eventually to have images saved like that

Re: [Pharo-project] image format with shebang

2012-10-16 Thread David T. Lewis
On Tue, Oct 16, 2012 at 03:08:45PM +0200, Sven Van Caekenberghe wrote: I understand that it would be nice eventually to have images saved like that automatically. It is still a pity that the VM has to change for that ;-) If you don't want to do it in the VM, you can do it with a shell

Re: [Pharo-project] image format with shebang

2012-10-16 Thread Sven Van Caekenberghe
On 16 Oct 2012, at 16:13, David T. Lewis le...@mail.msen.com wrote: If you don't want to do it in the VM, you can do it with a shell script. Just make a 512 byte file that starts with the shebang line that you want to use, prepend it to the saved image file (with /bin/cat) and set file mode

Re: [Pharo-project] image format with shebang

2012-10-16 Thread David T. Lewis
On Tue, Oct 16, 2012 at 05:32:57PM +0200, Sven Van Caekenberghe wrote: On 16 Oct 2012, at 16:13, David T. Lewis le...@mail.msen.com wrote: If you don't want to do it in the VM, you can do it with a shell script. Just make a 512 byte file that starts with the shebang line that you want

Re: [Pharo-project] image format with shebang

2012-10-16 Thread Yanni Chiu
On 16/10/12 10:13 AM, David T. Lewis wrote: If you don't want to do it in the VM, you can do it with a shell script. Just make a 512 byte file that starts with the shebang line that you want to use, prepend it to the saved image file (with /bin/cat) and set file mode executable (chmod). [So

Re: [Pharo-project] image format with shebang

2012-10-16 Thread David T. Lewis
On Tue, Oct 16, 2012 at 12:08:47PM -0400, Yanni Chiu wrote: On 16/10/12 10:13 AM, David T. Lewis wrote: If you don't want to do it in the VM, you can do it with a shell script. Just make a 512 byte file that starts with the shebang line that you want to use, prepend it to the saved image

Re: [Pharo-project] image format with shebang

2012-10-16 Thread Yanni Chiu
On 16/10/12 11:32 AM, Sven Van Caekenberghe wrote: line := '#!!/home/ubuntu/smalltalk/bin/CogVM -vm-display-null -vm-sound-null -plugins /home/ubuntu/smalltalk/bin/'. Is /home/ubuntu/smalltalk/bin/CogVM the executable binary or a shell script?

Re: [Pharo-project] image format with shebang

2012-10-16 Thread Sven Van Caekenberghe
On 16 Oct 2012, at 18:11, Yanni Chiu ya...@rogers.com wrote: On 16/10/12 11:32 AM, Sven Van Caekenberghe wrote: line := '#!!/home/ubuntu/smalltalk/bin/CogVM -vm-display-null -vm-sound-null -plugins /home/ubuntu/smalltalk/bin/'. Is /home/ubuntu/smalltalk/bin/CogVM the executable

Re: [Pharo-project] image format with shebang

2012-10-16 Thread Sven Van Caekenberghe
On 16 Oct 2012, at 18:05, David T. Lewis le...@mail.msen.com wrote: The parameters are not being passed to your VM in the way you expect. Here is what the man page for bash says: If the program is a file beginning with #!, the remainder of the first line specifies an

Re: [Pharo-project] image format with shebang

2012-10-16 Thread Sven Van Caekenberghe
On 16 Oct 2012, at 18:44, Sven Van Caekenberghe s...@stfx.eu wrote: On 16 Oct 2012, at 18:05, David T. Lewis le...@mail.msen.com wrote: The parameters are not being passed to your VM in the way you expect. Here is what the man page for bash says: If the program is a file beginning

[Pharo-project] image format with shebang

2012-10-13 Thread Camillo Bruni
how hard would it be to change the image file to include a shebang on the first line? for instance: #!/usr/bin/env pharo -headless like that images would serve as almost script files? I image something like everything until the first 0 or newline byte is ignored when loading the image...

Re: [Pharo-project] image format with shebang

2012-10-13 Thread Stefan Marr
On 13 Oct 2012, at 20:44, Camillo Bruni wrote: how hard would it be to change the image file to include a shebang on the first line? for instance: #!/usr/bin/env pharo -headless like that images would serve as almost script files? I image something like everything until the first 0

Re: [Pharo-project] image format with shebang

2012-10-13 Thread Camillo Bruni
On 2012-10-13, at 22:10, Stefan Marr smallt...@stefan-marr.de wrote: On 13 Oct 2012, at 20:44, Camillo Bruni wrote: how hard would it be to change the image file to include a shebang on the first line? for instance: #!/usr/bin/env pharo -headless like that images would serve as