content of binary files stored by save

View: New views
4 Messages — Rating Filter:   Alert me  

content of binary files stored by save

by TorokLev :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi all,

Does anybody know if file content can be listed?
I mean, once I saved a file with "save" command,
I want to know what variables are stored in it.
For example:

a=2;
b=4;
save -binary context.dat

restarting octave

load context.dat


I am particularily interested of this because loading from binary format is extremely
much faster so it is perfereble to use it.
However in a case of mine it is a bit larger. Which is either an error or I saved something that I didn't want to save.

Lev

--
Blogger of http://fapuma.blogspot.com


   ----- End of message -----


-------------------------------------------------------

--
Blogger of http://fapuma.blogspot.com

This is an automatically generated Delivery Status Notification

Delivery to the following recipient failed permanently:

     octave-help@...

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 550 550 5.1.1 <octave-help@...>... User unknown (state 14).

   ----- Original message -----

Received: by 10.210.133.2 with SMTP id g2mr4716860ebd.163.1222082103617;
        Mon, 22 Sep 2008 04:15:03 -0700 (PDT)
Return-Path: <toroklev@...>
Received: from vpn-client-16-62.corp.ukl.yahoo.com ( [217.12.15.52])
        by mx.google.com with ESMTPS id b36sm6293304ika.8.2008.09.22.04.15.02
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Mon, 22 Sep 2008 04:15:02 -0700 (PDT)
Reply-To: TorokLev@...
To: octave-help@...
Subject: file content
Date: Mon, 22 Sep 2008 13:15:00 +0200
User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405)
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200809221315.00996.TorokLev@...>
From: Levente Torok <toroklev@...>

Hi all,

Does anybody know if file content can be listed?
I mean, once I saved a file with "save" command, I want to know what variables are stored in it.

Lev

--
Blogger of http://fapuma.blogspot.com


   ----- End of message -----


_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: content of binary files stored by save

by David Bateman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Levente Torok wrote:

> Hi all,
>
> Does anybody know if file content can be listed?
> I mean, once I saved a file with "save" command,
> I want to know what variables are stored in it.
> For example:
>
> a=2;
> b=4;
> save -binary context.dat
>
> restarting octave
>
> load context.dat
>
>
> I am particularily interested of this because loading from binary format is extremely
> much faster so it is perfereble to use it.
> However in a case of mine it is a bit larger. Which is either an error or I saved something that I didn't want to save.
>
> Lev
>
>  

If its large does the "-z" flag to save help?

As for listing the contents, matlab has the "whos -file <file.mat>"
command that Octave does yet implement. I took a look at adding this a
few months ago, but if I remember correctly it wasn't clear how to do it
cleanly. Till then Octave implements "load -list <file.mat>" which is
similar that lists the contents without loading the variables, but
doesn't give any details like "whos -file <file.mat>" does..

Regards
David



--
David Bateman                                David.Bateman@...
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax)

The information contained in this communication has been classified as:

[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: content of binary files stored by save

by David Bateman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

David Bateman wrote:

> Levente Torok wrote:
>> Hi all,
>>
>> Does anybody know if file content can be listed?
>> I mean, once I saved a file with "save" command, I want to know what
>> variables are stored in it.
>> For example:
>>
>> a=2;
>> b=4;
>> save -binary context.dat
>>
>> restarting octave
>>
>> load context.dat
>>
>>
>> I am particularily interested of this because loading from binary
>> format is extremely
>> much faster so it is perfereble to use it.
>> However in a case of mine it is a bit larger. Which is either an
>> error or I saved something that I didn't want to save.
>>
>> Lev
>>
>>  
>
> If its large does the "-z" flag to save help?
>
> As for listing the contents, matlab has the "whos -file <file.mat>"
> command that Octave does yet implement. I took a look at adding this a
> few months ago, but if I remember correctly it wasn't clear how to do
> it cleanly. Till then Octave implements "load -list <file.mat>" which
> is similar that lists the contents without loading the variables, but
> doesn't give any details like "whos -file <file.mat>" does..
>
> Regards
> David
>
>
>
Sorry you can also do "load -list -v <file.mat>", though that doesn't
appear t be adapted to NDArrays.

D.


--
David Bateman                                David.Bateman@...
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax)

The information contained in this communication has been classified as:

[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

Re: content of binary files stored by save

by Francesco Potortì :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>Does anybody know if file content can be listed?
>I mean, once I saved a file with "save" command,
>I want to know what variables are stored in it.
>For example:
>
>a=2;
>b=4;

octave> save -binary context.dat a b

octave> fieldnames(load("context.dat"))
ans =

{
  [1,1] = a
  [2,1] = b
}

--
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: Potorti@...
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
LightInTheBox - Buy quality products at wholesale price!