Write entire file: Difference between revisions

Content added Content deleted
(→‎{{header|Perl 6}}: Added Perl 6 solution)
(=={{header|Racket}}== implementation added)
Line 30: Line 30:
f.write(data)
f.write(data)
</lang>
</lang>

=={{header|Racket}}==
This only replaces the file if it exists, otherwise it writes a new file.
<lang racket>#lang racket/base
(with-output-to-file "tmp/out-file.txt" #:exists 'replace
(lambda () (display "characters")))</lang>


=={{header|REXX}}==
=={{header|REXX}}==