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

Home » Public Forums » archive » File sizes and the SAVE command
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
File sizes and the SAVE command [message #48054] Wed, 22 March 2006 01:39
Carsten Pathe is currently offline  Carsten Pathe
Messages: 5
Registered: December 2002
Junior Member
Hi there,

I am wondering about the IDL save command and the disk space of the
created save files.
Just an simple example:

a=intarr(100000)
tmp = size(a)
print, string(format='(f10.3)',(tmp(1)*tmp(2))/(2.^10.))+' kbyte'
;195.313 kbyte
save, a, filename='d:\temp\test\b.dat'

b=fltarr(100000)
tmp = size(b)
print, string(format='(f10.3)',(tmp(1)*tmp(2))/(2.^10.))+' kbyte'
;390.625 kbyte
save, a, filename='d:\temp\test\a.dat'

c=dblarr(100000)
tmp = size(c)
print, string(format='(f10.3)',(tmp(1)*tmp(2))/(2.^10.))+' kbyte'
;488.281 kbyte
save, c, filename='d:\temp\test\c.dat'

When you look at the created files and their sizes, you will see the
following:
a.dat 393 kb
b.dat 393 kb
c.dat 784 kb

If you compare the file sizes to the sizes, the arrays were allocating
in the memory before they were save to disk, you see differences which
will cost you a lot of disk space when saving arrays of several hundred
megabytes.
Does anybody know, why the save command is producing files larger than
they should be?

PS: I know, that I can also use:
openw, 10, 'd:\temp\test\a.dat'
writeu, 10, a
close, 10
But when I want to restore the data, I have to know the structure of the
data to restore - which is not always the case.

Thanks a lot help
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Need IDL Programmer
Next Topic: 4D interpolation

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

Current Time: Fri Oct 10 15:51:13 PDT 2025

Total time taken to generate the page: 1.60191 seconds