octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: save options handling


From: David Bateman
Subject: Re: save options handling
Date: Fri, 29 Apr 2005 09:25:52 +0200
User-agent: Mozilla Thunderbird 0.8 (X11/20040923)

Daniel J Sebald wrote:

Dmitri A. Sergatskov wrote:

I think it is a bug, but may be I misunderstood the logic:

default_save_options = -binary -zip
crash_dumps_octave_core = 0
octave:1> x=1;
octave:2> save -text x.txt x
octave:3> quit
address@hidden octave]$ file x.txt
x.txt: gzip compressed data, from Unix

Should not that be ASCII text?


As you suggest above, it is how you interpret the logic I guess. If you were to unzip x.txt, you may find it is text. That is, text/binary are two complementary options. -zip is an additional, independent option. You may be thinking that -text at the command line should override all default settings.

Dan


Errr, if there existed a "-nozip" option this would have been the logic. Unfortunately there isn't. Either implementing complementary options or only using the default_save_options if there are no other options would be very easy. I tend to feel that complementary options are better, as in some ways its closer to the old logic, and if you had

default_save_options = "-binary";
save -zip test.mat x

complementary options are the only ones that make sense....

Attached find a patch to add the "-nozip" option...

Cheers
David



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

The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary

*** src/load-save.cc~   2005-04-26 21:28:29.000000000 +0200
--- src/load-save.cc    2005-04-29 09:21:37.000000000 +0200
***************
*** 1151,1156 ****
--- 1151,1160 ----
        {
          use_zlib  = true;
        }
+       else if (argv[i] == "-nozip" || argv[i] == "-nz")
+       {
+         use_zlib  = false;
+       }
  #endif
        else
        break;
***************
*** 1507,1513 ****
  @itemx -z\n\
  Use the gzip algorithm to compress the file. This works equally on files 
that\n\
  are compressed with gzip outside of octave, and gzip can equally be used to\n\
! convert the files for backward compatibility"
  
  HAVE_ZLIB_HELP_STRING
  
--- 1511,1523 ----
  @itemx -z\n\
  Use the gzip algorithm to compress the file. This works equally on files 
that\n\
  are compressed with gzip outside of octave, and gzip can equally be used to\n\
! convert the files for backward compatibility."
! 
! HAVE_ZLIB_HELP_STRING
! 
! "@item -nozip\n\
! @itemx -nz\n\
! Disable the use of the file compression."
  
  HAVE_ZLIB_HELP_STRING
  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]