Create a file: Difference between revisions

+Icon+Unicon
m (→‎{{header|APL}}: fix <lang> tag)
(+Icon+Unicon)
Line 331:
SYSTEM(DIR="C:\docs") ! create C:\docs if not existent, make it current
OPEN(FILE="output.txt", "NEW") ! in C:\docs </lang>
 
== Icon and Unicon ==
==={{header|Icon}}===
Icon does not support 'mkdir' - otherwise the Unicon code below will work. A work around would be to use 'system' to invoke command line to create a directory.
==={{header|Unicon}}===
<lang Unicon>every dir := !["./","/"] do {
close(open(f := dir || "input.txt","w")) |stop("failure for open ",f)
mkdir(f := dir || "docs") |stop("failure for mkdir ",f)
}</lang>
 
=={{header|J}}==
Anonymous user