Create a file: Difference between revisions

Content deleted Content added
m →‎{{header|C}}: added missing headers; fixed nested comment
Add Seed7 example
Line 863: Line 863:
/output.txt: empty
/output.txt: empty
I am not aware of any '''standard''' way of creating directories in Scheme.
I am not aware of any '''standard''' way of creating directories in Scheme.

=={{header|Seed7}}==
Seed7 uses a [http://seed7.sourceforge.net/manual/os.htm#Standard_path_representation standard path representation]
to make paths operating system independent. In the standard path representation
a / is used as path delimiter and drive letters like C: must be written as /c instead.
Creating files and directories in a file system root may need privileges, so the program may fail,
when it is started by a normal user.

<lang seed7>$ include "seed7_05.s7i";
include "osfiles.s7i";

const proc: main is func
local
var file: aFile is STD_NULL;
begin
aFile := open("output.txt", "w");
close(aFile);
mkdir("docs");
aFile := open("/output.txt", "w");
close(aFile);
mkdir("/docs");
end func;</lang>

Under Windows each filesystem has its own root.
Therefore you need to replace "/output.txt" and "/docs" with "/c/output.txt" and "/c/docs".


=={{header|Slate}}==
=={{header|Slate}}==