Jump to content

File input/output: Difference between revisions

added language octave
(added language octave)
Line 1,715:
 
(Notice that ic and oc, of type ''in_channel'' and ''out_channel'', are buffered)
 
=={{header|Octave}}==
<lang octave>
in = fopen("input.txt", "r", "native");
out = fopen("output.txt", "w","native");
if (in == -1)
disp("Error opening input.txt for reading.");
else
if (out == -1)
disp("Error opening output.txt for writing.");
else
while (1)
[val,count]=fread(in,1,"uchar",0,"native");
if (count > 0)
count=fwrite(out,val,"uchar",0,"native");
if (count == 0)
disp("Error writing to output.txt.");
end
else
break;
end
endwhile
end
end
if (in != -1)
fclose(in);
end
if (out != -1)
fclose(out);
end
</lang>
 
=={{header|OpenEdge/Progress}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.