Status: Accepted Owner: camillob...@gmail.com Labels: Type-Defect Priority-Medium
New issue 101 by camillob...@gmail.com: Snapshot primitive with 512byte image header http://code.google.com/p/cog/issues/detail?id=101
I would like to add proper shebang support to our image files. Hence I need a proper primitive which allows me to inject the 512bytes header with a proper shebang (or other user data..)
This could be handled the same way as the quit primitive by checking for an optional argument, the header, and pass it along to #writeImageFile:
On Sun, Oct 14, 2012 at 11:09:25AM +0000, cog@googlecode.com wrote:
Status: Accepted Owner: camillob...@gmail.com Labels: Type-Defect Priority-Medium
New issue 101 by camillob...@gmail.com: Snapshot primitive with 512byte image header http://code.google.com/p/cog/issues/detail?id=101
I would like to add proper shebang support to our image files. Hence I need a proper primitive which allows me to inject the 512bytes header with a proper shebang (or other user data..)
This could be handled the same way as the quit primitive by checking for an optional argument, the header, and pass it along to #writeImageFile:
FYI, the hook for this is a macro in platforms/Cross/vm/sq.h:
#define sqImageFileStartLocation(fileRef, fileName, size) 0
If you implement this as a function that writes the shebang line followed by <lf>, and pads with null for the first 512 bytes, then answers 512 as the result, you will have what you want. You should probably set the image file writable while you're at it.
HTH, Dave
On 2012-10-14, at 18:50, David T. Lewis lewis@mail.msen.com wrote:
On Sun, Oct 14, 2012 at 11:09:25AM +0000, cog@googlecode.com wrote:
Status: Accepted Owner: camillob...@gmail.com Labels: Type-Defect Priority-Medium
New issue 101 by camillob...@gmail.com: Snapshot primitive with 512byte image header http://code.google.com/p/cog/issues/detail?id=101
I would like to add proper shebang support to our image files. Hence I need a proper primitive which allows me to inject the 512bytes header with a proper shebang (or other user data..)
This could be handled the same way as the quit primitive by checking for an optional argument, the header, and pass it along to #writeImageFile:
FYI, the hook for this is a macro in platforms/Cross/vm/sq.h:
#define sqImageFileStartLocation(fileRef, fileName, size) 0
If you implement this as a function that writes the shebang line followed by <lf>, and pads with null for the first 512 bytes, then answers 512 as the result, you will have what you want. You should probably set the image file writable while you're at it.
thanks, I will have a look at it possibly next week.
cami
Comment #1 on issue 101 by guillermopolito@gmail.com: Snapshot primitive with 512byte image header http://code.google.com/p/cog/issues/detail?id=101
Mirrored in https://pharo.fogbugz.com/default.asp?pre=preMultiSearch&pg=pgList&p...
vm-dev@lists.squeakfoundation.org