Mercurial > hg > octave-terminal
changeset 5431:6ddb5a7f399e
[project @ 2005-08-29 20:48:29 by jwe]
author | jwe |
---|---|
date | Mon, 29 Aug 2005 20:48:52 +0000 |
parents | 150d5140fcb0 |
children | a42806a03f8f |
files | scripts/ChangeLog scripts/image/saveimage.m scripts/miscellaneous/bug_report.m test/octave.test/io/file-pos-1.m test/octave.test/io/fopen-1.m test/octave.test/io/fopen-4.m test/octave.test/io/fopen-6.m test/octave.test/system/rename-1.m test/octave.test/system/umask-1.m test/octave.test/system/unlink-1.m |
diffstat | 10 files changed, 31 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,9 @@ +2005-08-29 Bill Denney <denney@seas.upenn.edu> + + * image/saveimage.m: Open output file in binary mode. + + * miscellaneous/bug_report.m: Open prefs file in text mode. + 2005-08-16 John W. Eaton <jwe@octave.org> * miscellaneous/computer.m: Handle optional maxsize and endian @@ -66,7 +72,7 @@ * statistics/distributions/tinv.m: Rename from t_inv.m. * statistics/distributions/tpdf.m: Rename from t_pdf.m. * statistics/distributions/trnd.m: Rename from t_rnd.m. - * statistics/distributions/unifcdf.m: Rename from uniform_cdf.m. + * statistics/distributions/unifcdf.m: Rename from unifoxorm_cdf.m. * statistics/distributions/unifinv.m: Rename from uniform_inv.m. * statistics/distributions/unifpdf.m: Rename from uniform_pdf.m. * statistics/distributions/unifrnd.m: Rename from uniform_rnd.m.
--- a/scripts/image/saveimage.m +++ b/scripts/image/saveimage.m @@ -186,7 +186,7 @@ tmp(i,:) = sum (bwimg(8*(i-1)+1:8*i,:) .* b); endfor - fid = fopen (filename, "w"); + fid = fopen (filename, "wb"); fprintf (fid, "P4\n%s\n%d %d\n", tagline, img_nr, img_nc); fwrite (fid, tmp, "char"); fprintf (fid, "\n"); @@ -194,7 +194,7 @@ elseif (grey) - fid = fopen (filename, "w"); + fid = fopen (filename, "wb"); fprintf (fid, "P5\n%s\n%d %d\n255\n", tagline, img_nr, img_nc); fwrite (fid, map(img), "uchar"); fprintf (fid, "\n"); @@ -216,7 +216,7 @@ tmap = map(map_idx); tmp(img_idx--) = tmap(img); - fid = fopen (filename, "w"); + fid = fopen (filename, "wb"); fprintf (fid, "P6\n%s\n%d %d\n255\n", tagline, img_nr, img_nc); fwrite (fid, tmp, "uchar"); fprintf (fid, "\n"); @@ -266,7 +266,7 @@ urx = llx + fix (scols + 0.5); ury = lly + fix (srows + 0.5); - fid = fopen (filename, "w"); + fid = fopen (filename, "wb"); fprintf (fid, "%%!PS-Adobe-2.0 EPSF-2.0\n"); fprintf (fid, "%%%%Creator: Octave %s (saveimage.m)\n", OCTAVE_VERSION);
--- a/scripts/miscellaneous/bug_report.m +++ b/scripts/miscellaneous/bug_report.m @@ -43,7 +43,7 @@ prefs = tmpnam (); if (! isempty (prefs)) - fid = fopen (prefs, "w"); + fid = fopen (prefs, "wt"); if (fid > 0) dump_prefs (fid); fclose (fid);
--- a/test/octave.test/io/file-pos-1.m +++ b/test/octave.test/io/file-pos-1.m @@ -1,16 +1,16 @@ nm = tmpnam (); -id = fopen (nm, "w"); +id = fopen (nm, "wb"); if (id > 0) fprintf (id, "%d\n", 1:100); fclose (id); - id = fopen (nm, "r"); + id = fopen (nm, "rb"); if (id > 0) for i = 1:101 fgets (id); endfor if (feof (id)) fclose (id); - id = fopen (nm, "r"); + id = fopen (nm, "rb"); pos_one = ftell (id); s_one = fgets (id); for i = 1:48
--- a/test/octave.test/io/fopen-1.m +++ b/test/octave.test/io/fopen-1.m @@ -4,11 +4,19 @@ for i = 1:6 arch = deblank (arch_list (i,:)); - for j = 1:2 + for j = 1:6 if (j == 1) mode_list = ["w"; "r"; "a"]; - else + elseif (j == 2) mode_list = ["w+"; "r+"; "a+"]; + elseif (j == 3) + mode_list = ["wb"; "rb"; "ab"]; + elseif (j == 4) + mode_list = ["w+b"; "r+b"; "a+b"]; + elseif (j == 5) + mode_list = ["wt"; "rt"; "at"]; + elseif (j == 6) + mode_list = ["w+t"; "r+t"; "a+t"]; endif nm = tmpnam (); for k = 1:3
--- a/test/octave.test/io/fopen-4.m +++ b/test/octave.test/io/fopen-4.m @@ -1,1 +1,1 @@ -fopen ("foo", "w", "noodle") +fopen ("foo", "wb", "noodle")
--- a/test/octave.test/io/fopen-6.m +++ b/test/octave.test/io/fopen-6.m @@ -1,1 +1,1 @@ -fopen ("foo", "w", "native", 1) +fopen ("foo", "wb", "native", 1)
--- a/test/octave.test/system/rename-1.m +++ b/test/octave.test/system/rename-1.m @@ -1,6 +1,6 @@ from = tmpnam (); to = tmpnam (); -id = fopen (from, "w"); +id = fopen (from, "wb"); if (id > 0 && fclose (id) == 0) [s, e] = stat (from); if (! e)
--- a/test/octave.test/system/umask-1.m +++ b/test/octave.test/system/umask-1.m @@ -1,13 +1,13 @@ umask (0); nm = tmpnam (); -id = fopen (nm, "w"); +id = fopen (nm, "wb"); s1 = stat (nm); fclose (id); unlink (nm); umask (777); nm = tmpnam (); -id = fopen (nm, "w"); +id = fopen (nm, "wb"); s2 = stat (nm); fclose (id); unlink (nm);