f



zip/unzip files

Is it possible to zip/unzip - using swi's?

ie DIM some space - load the file into the space - and call swi's to 
uncompress the file into a second DIM space2.

How do you know the size of the second space2?

-- 
Colin Ferris Cornwall UK
0
cferris
8/29/2016 11:19:15 AM
comp.sys.acorn.programmer 2499 articles. 0 followers. Post Follow

4 Replies
196 Views

Similar Articles

[PageSpeed] 2

On 29/08/2016 12:19, cferris@freeRemoveuk.com.invalid wrote:
> Is it possible to zip/unzip - using swi's?
>
> ie DIM some space - load the file into the space - and call swi's to
> uncompress the file into a second DIM space2.
>
> How do you know the size of the second space2?
>
There is no direct support for ZIP format files in the OS, but the 
Squash file format compression can be used from SWI calls.

IIRC the !SparkFS module has a SWI interface.

---druck
0
druck
8/29/2016 11:33:29 AM
On 29/08/16 12:19, cferris@freeRemoveuk.com.invalid wrote:

> Is it possible to zip/unzip - using swi's?

> ie DIM some space - load the file into the space - and call swi's to
> uncompress the file into a second DIM space2.

> How do you know the size of the second space2?

See Druck's reply, obviously - but are you perhaps overthinking this? Do 
you actually need to do what you _think_ you want to do?

Provided something suitable is running, then you can treat the zip file 
just like a normal directory. I've only ever done this to read the 
contents of zip files (using SparkPlug*), but if the software providing 
the image filing system is read/write capable (such as SparkFS*) then I 
imagine you can write to it as well.

* More specifically, the FS module that it loads. Nothing RISC OS is 
switched on at the moment, so I can't check.

Alternatively, you can issue 'star commands' from within your program, 
so you could use command line tools to do the job: zip and unzip, which 
are provided with !InfoZip by Harriet Bazley.

http://www.starfighter.acornarcade.com/mysite/utilities.htm

-- 
Vince M Hudd
Soft Rock Software
0
Vince
8/29/2016 3:34:51 PM
The SparkFS *ZipUnCompress <source> <dest> command will unzip a single
zipped file. I have code that copies the required data to <Wimp$ScrapFile>
then does *ZipUnCompress <Wimp$ScrapFile> destfile

You can do the same the other way around, copy uncompressed data to
<Wimp$ScrapFile> then *ZipCompress <Wimp$Scrap> destfile

jgh
0
jgh
9/5/2016 12:46:26 AM
In message <8c8d0e68-a7b2-4a3e-99c5-ebffb1273406@googlegroups.com>
          jgh@mdfs.net wrote:

> The SparkFS *ZipUnCompress <source> <dest> command will unzip a single
> zipped file. I have code that copies the required data to <Wimp$ScrapFile>
> then does *ZipUnCompress <Wimp$ScrapFile> destfile

> You can do the same the other way around, copy uncompressed data to
> <Wimp$ScrapFile> then *ZipCompress <Wimp$Scrap> destfile

Thanks for that - Ref ZipUnCompress - what does [source offset] 
mean/do?

Syntax: *ZipUncompress <source> <destination> [source offset]


-- 
Colin Ferris Cornwall UK
0
cferris
9/6/2016 12:39:05 PM
Reply: