comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: gziped files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: gziped files [message #11386 is a reply to message #11380] Thu, 09 April 1998 00:00 Go to previous message
dlhopols is currently offline  dlhopols
Messages: 10
Registered: April 1998
Junior Member
In article <6gi5lk$ah8$1@info.abdn.ac.uk>,
mph406@biomed.abdn.ac.uk wrote:
>
> Is there a way to access a directory containing gzipped files (images in
this case), unzip those files,
> read them into an array (which I can already do when unzipped manually from
the system prompt) and then re-zip the files, all within a .pro.


I just did this a while ago, I have rather a complicated directory
pathname but the FINDFILE command finds all matching files and puts them
into a string array. All that you really need to know is the command
and SPAWN lines. The SPAWN command unzips the file without affecting it
in any way.
There is no need to re-zip it, and it can be write protectd. The data is
piped into a unit number which can be read with: readu,lun,dataimage
or whatever read command you use. (Check out Esrg-3.2 libraries
referenced on the IDL pages, idl-fortran contains some example
code.)
>>>> code:
file_string = data_path
print,file_string
filename_array=FINDFILE(data_path+wildcard,COUNT=number_of_f iles)
print,'Information about Matching Files:'
help,filename_array
; Prints out names of data files found
print,'Name of file found:',filename_array

IF (number_of_files GT 0) THEN BEGIN
FOR i = 0, number_of_files-1 DO BEGIN

command = 'zcat '+filename_array(i)
SPAWN,command,unit = lun
print,'..Reading output from command ',command
...
dataimage=intarr(pif_c,pif_l)
readu,lun,dataimage
...
free_lun,lun
return
end


I hope I didn't forget anything. Good luck!

Rose

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Astronaut design proposed for new USA $1 coin
Next Topic: Re: Volume Size

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 15 16:48:14 PDT 2025

Total time taken to generate the page: 2.40086 seconds