[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fopen: default open mode is now binary?
From: |
mavram |
Subject: |
Re: fopen: default open mode is now binary? |
Date: |
Thu, 7 Apr 2005 16:51:06 +0300 |
User-agent: |
Mutt/1.5.5.1+cvs20040105i |
On Thu, Apr 07, 2005 at 08:56:45AM -0400, Vic Norton wrote:
> I have just upgraded octave on my Mac (OS X) form 2.1.57 to 2.1.69. I
> am now getting a warning message that I am curious about:
>
> warning: fopen: default open mode is now binary
>
> What should I do about this? It doesn't seem to present a problem. I
> am simply writing a text file
> file = "Output/portfolioValues.csv";
> fid = fopen(file, "w");
> fprintf (fid, "Data for getCurrentValue.pl\n");
> fprintf (fid, "date0, %s\n", date0);
> ...
> fclose (fid);
> for subsequent processing by Perl. The correct text is being written.
> Is there something I can add to my "fopen" line to prevent the
> warning?
>
> Regards,
>
> Vic
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web: http://www.octave.org
> How to fund new projects: http://www.octave.org/funding.html
> Subscription information: http://www.octave.org/archive.html
> -------------------------------------------------------------
Hi
If you write explicitely fid = fopen(file, "wt"), instead of just
fid = fopen(file, "w"); you won't get any warning.
But I am surprised that octave accepted the argument
file = "Output/portfolioValues.csv"
On my system, the succession of commands:
file = "Output/portfolioValues.csv";
fid = fopen(file, "w")
gave the output: fid = -1; i.e. no file was opened. Only when I
left out the Output/ part did it behave correctly
I guess this is due to the fact that you use Mac OS while I am
using linux: The meaning and treatment of the forward slash is
apparently different.
Cheers, Avraha
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------