Mercurial > hg > octave-lyh
view test/octave.test/io/fopen-1.m @ 4036:1432e11733d1
[project @ 2002-08-12 18:38:40 by jwe]
author | jwe |
---|---|
date | Mon, 12 Aug 2002 18:38:40 +0000 |
parents | c34d631dee18 |
children | 6ddb5a7f399e |
line wrap: on
line source
arch_list = ["native"; "ieee-le"; "ieee-be"; "vaxd"; "vaxg"; "cray"]; status = 1; for i = 1:6 arch = deblank (arch_list (i,:)); for j = 1:2 if (j == 1) mode_list = ["w"; "r"; "a"]; else mode_list = ["w+"; "r+"; "a+"]; endif nm = tmpnam (); for k = 1:3 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); status = 0; break; else fclose (id); endif mode = strcat (mode, "b"); [id, err] = fopen (nm, mode, arch); if (id < 0) printf ("open failed: %s (%s, %s): %s\n", nm, mode, arch, err); status = 0; break; else fclose (id); endif endfor if (status == 0) break; endif endfor if (status == 0) break; endif endfor status == 1