Write entire file: Difference between revisions
→{{header|PHP}}
(→{{header|Perl}}: show utf8 by default) |
|||
Line 197:
=={{header|PHP}}==
<lang php>file_put_contents($filename, $data)</lang>
=={{header|PureBasic}}==
<lang PureBasic>
EnableExplicit
Define fOutput$ = "output.txt" ; enter path of file to create or overwrite
Define str$ = "This string is to be written to the file"
If OpenConsole()
If CreateFile(0, fOutput$)
WriteString(0, str$)
Else
PrintN("Error creating or opening output file")
EndIf
PrintN("Press any key to close the console")
Repeat: Delay(10) : Until Inkey() <> ""
CloseConsole()
EndIf
</lang>
{{out|Output (contents of 'output.exe')}}
<pre>
This string is to be written to the file
</pre>
=={{header|Python}}==
|