Mercurial > hg > octave-nkf
changeset 5432:a42806a03f8f
[project @ 2005-08-29 20:55:27 by jwe]
author | jwe |
---|---|
date | Mon, 29 Aug 2005 20:55:27 +0000 |
parents | 6ddb5a7f399e |
children | 2f51d6d65fb2 |
files | test/octave.test/io/fopen-1.m |
diffstat | 1 files changed, 13 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/test/octave.test/io/fopen-1.m +++ b/test/octave.test/io/fopen-1.m @@ -9,18 +9,10 @@ mode_list = ["w"; "r"; "a"]; 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 - mode = deblank (mode_list (k,:)); + mode = deblank (mode_list (k,:)) [id, err] = fopen (nm, mode, arch); if (id < 0) printf ("open failed: %s (%s, %s): %s\n", nm, mode, arch, err); @@ -29,10 +21,19 @@ else fclose (id); endif - mode = strcat (mode, "b"); - [id, err] = fopen (nm, mode, arch); + tmp_mode = strcat (mode, "b"); + [id, err] = fopen (nm, tmp_mode, arch); if (id < 0) - printf ("open failed: %s (%s, %s): %s\n", nm, mode, arch, err); + printf ("open failed: %s (%s, %s): %s\n", nm, tmp_mode, arch, err); + status = 0; + break; + else + fclose (id); + endif + tmp_mode = strcat (mode, "t"); + [id, err] = fopen (nm, tmp_mode, arch); + if (id < 0) + printf ("open failed: %s (%s, %s): %s\n", nm, tmp_mode, arch, err); status = 0; break; else