File input/output: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 2,932: | Line 2,932: | ||
=={{header|SenseTalk}}== |
=={{header|SenseTalk}}== |
||
Reading the file all at once: |
|||
<lang sensetalk>put file "input.txt" into fileContents |
<lang sensetalk>put file "input.txt" into fileContents |
||
put fileContents into file "output.txt"</lang> |
put fileContents into file "output.txt"</lang> |
||
Reading the file line by line: |
|||
<lang sensetalk>put "input.txt" into inputFile |
|||
put "output.txt" into outputFile |
|||
open file inputFile |
|||
open file outputFile for writing |
|||
repeat forever |
|||
read from file inputFile until return |
|||
if it is empty then exit repeat |
|||
write it to file outputFile |
|||
end repeat |
|||
close file inputFile |
|||
close file outputFile</lang> |
|||
=={{header|Sidef}}== |
=={{header|Sidef}}== |