September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -1 +1,2 @@
ERASE "m"; 1; "INPUTTXT"
DELETE FILE "input.txt"
DELETE FILE "/input.txt"

View file

@ -1 +1 @@
ERASE "a:INPUTTXT"
ERASE "m"; 1; "INPUTTXT"

View file

@ -0,0 +1 @@
ERASE "a:INPUTTXT"

View file

@ -0,0 +1,8 @@
VAR
l: Files.Locator;
BEGIN
(* Locator is the directory *)
l := Files.dir.This("proof");
(* delete 'xx.txt' file, in directory 'proof' *)
Files.dir.Delete(l,"xx.txt");
END ...

View file

@ -1,13 +1,12 @@
#import system.
#import system'io.
import system'io.
#symbol program =
program =
[
"output.txt" file_path delete.
File new:"output.txt"; delete.
"\output.txt" file_path delete.
File new:"\output.txt"; delete.
"docs" directory_path delete.
Directory new:"docs"; delete.
"\docs" directory_path delete.
Directory new:"\docs"; delete.
].

View file

@ -0,0 +1,8 @@
Public Sub Main()
Kill User.home &/ "input.txt"
Rmdir User.home &/ "docs"
'Administrative privileges (sudo) would be required to mess about in Root - I'm not going there!
End

View file

@ -0,0 +1,5 @@
# Delete a file
rm("input.txt")
# Delete a directory
rm("docs", recursive = true)

View file

@ -0,0 +1,18 @@
// version 1.0.6
/* testing on Windows 10 which needs administrative privileges
to delete files from the root */
import java.io.File
fun main(args: Array<String>) {
val paths = arrayOf("input.txt", "docs", "c:\\input.txt", "c:\\docs")
var f: File
for (path in paths) {
f = File(path)
if (f.delete())
println("$path successfully deleted")
else
println("$path could not be deleted")
}
}

View file

@ -1,5 +0,0 @@
import os
removeFile("input.txt")
removeFile("/input.txt")
removeDir("docs")
removeDir("/docs")

View file

@ -0,0 +1,5 @@
/*REXX pgm deletes a file */
file= 'afile.txt' /*name of a file to be deleted.*/
res=sysFileDelete(file); Say file 'res='res
File= 'bfile.txt' /*name of a file to be deleted.*/
res=sysFileDelete(file); Say file 'res='res

View file

@ -0,0 +1,5 @@
constant root = iff(platform()=LINUX?"/":"C:\\")
?delete_file("input.txt")
?delete_file(root&"input.txt")
?remove_directory("docs")
?remove_directory(root&"docs")

View file

@ -0,0 +1,25 @@
use std::io::{self, Write};
use std::fs::{remove_file,remove_dir};
use std::path::Path;
use std::{process,display};
const FILE_NAME: &'static str = "output.txt";
const DIR_NAME : &'static str = "docs";
fn main() {
delete(".").and(delete("/"))
.unwrap_or_else(|e| error_handler(e,1));
}
fn delete<P>(root: P) -> io::Result<()>
where P: AsRef<Path>
{
remove_file(root.as_ref().join(FILE_NAME))
.and(remove_dir(root.as_ref().join(DIR_NAME)))
}
fn error_handler<E: fmt::Display>(error: E, code: i32) -> ! {
let _ = writeln!(&mut io::stderr(), "{:?}", error);
process::exit(code)
}

View file

@ -0,0 +1,2 @@
erase input.txt
rmdir docs

View file

@ -0,0 +1,13 @@
zkl: System.cmd((System.isWindows and "del" or "unlink") + " input.txt")
0
zkl: System.cmd((System.isWindows and "del" or "unlink") + " /input.txt")
unlink: cannot unlink /input.txt: No such file or directory
256
zkl: System.cmd("rmdir docs")
rmdir: failed to remove docs: Directory not empty
256
zkl: System.cmd("rm -r docs")
0
zkl: System.cmd("rm -r /docs")
rm: cannot remove /docs: No such file or directory
256