On Mon, Dec 05, 2005 at 02:55:32PM +0100, Pim Snel wrote:
On Fri, 2005-12-02 at 01:07 +0100, Pim Snel wrote:
I enhanced the first extension, which was able to save a zip archive with svg and images, with an extra extension which is able to read the archive instantly. I changed the zip-extention to .zink which is of course a combination of Zip and Inkscape.
I'd agree with Alan here. I think that ".svg.zip" would probably be better. This would probably assist in interoperability with other tools and will make users understand what they have better.
There is one advantage in giving it its own extension. The system can register this as mime type and automaticly open inkscape when it sees a *zink.
But I don't have any problems with the .svg.zip extension, so if you all agree I will change it to .svg.zip.
I also think .zink would be fine. IIRC, the .jar format is also .zip underneath.
In fact... Were you aware of the 'inkjar' format that was implemented early on in Inkscape? I think it's akin to what you've done, although it wasn't very well documented. It might be wise to review that and if zink can do everything the inkjar format did, to deprecate inkjar and remove it from the codebase.
Also, please be sure to document and advertize this .zink format widely; I think part of the problem with inkjar was that its use didn't get documented so people didn't really use it, and ended up forgetting about it. It would be good for zink to take advantage of that lesson learned. ;-)
One thing that I'm curious about, is how we can clean up from the input extension. It sounds like it leaves the files in the temporary directory, which makes sense, but I'd like to be "good citizens" and clean up after ourselves. Does anyone have any ideas on this?
I don't really know how to achieve this? Maybe inkscape can create its own temporary directory which it removes after closing inkscape. Extensions could use this temporary directory.
Yes, I think most POSIX systems have a way to create temporary files and temporary directories that are automatically removed when the process exits. This is the typical (and most secure) way of handling it. The dir is named using the process id and usually placed in the system temp directory (e.g., on Linux /tmp or /var/tmp; on Windows C:\TEMP; etc.)
It would probably be worthwhile for you to look into how inkjar does it. I think inkjar doesn't actually need a temp dir; it just creates or reads the individual files directly into the archive. The code is in src/inkjar/. It's just one .cpp file.
Bryce