Anonymous user
File input/output: Difference between revisions
m
Spelling/case, as in <http://en.wikipedia.org/wiki/Input/output>.
m (Mortense moved page File IO to File input/output: Expansion.) |
m (Spelling/case, as in <http://en.wikipedia.org/wiki/Input/output>.) |
||
Line 276:
<lang autohotkey>FileRead, var, input.txt
FileAppend, %var%, output.txt</lang>
Method 3: the file can be copied without
<lang autohotkey>FileCopy, input.txt, output.txt</lang>
Binary
=={{header|AWK}}==
Line 406:
It uses <code>fgetc</code> to read one character at a time. Each character is visited, even though there's nothing to do with it. Copying bigger blocks of data is much more efficient.
The following example addresses those issues. To avoid buffered
{{works with|POSIX}}
Line 1,231:
}</lang>
This version closes both files after without OS intervention.
<lang java>import java.io.*;
Line 2,061:
In rexx, filename association is used rather than numeric stream numbers and explicit file opening is not required.
===
<lang rexx>/*REXX program to read a file and store the contents into an output file*/
Line 2,073:
end
/*stick a fork in it, we're done.*/</lang>
===
<lang rexx>/*REXX program to read a file and store the contents into an output file*/
/*(same as the 1st example, but is faster because no intermediate step.)*/
Line 2,086:
/*stick a fork in it, we're done.*/</lang>
===
Note that this version is limited to files less than one million bytes (and/or possibly virtual memory).
<lang rexx>/*REXX program to read a file and write contents to an output file*****
|