langs a-z

This commit is contained in:
Ingy döt Net 2013-04-10 22:43:41 -07:00
parent db842d013d
commit d066446780
11389 changed files with 98361 additions and 1020 deletions

View file

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

View file

@ -0,0 +1,2 @@
Sys.remove "input.txt";;
Sys.remove "/input.txt";;

View file

@ -0,0 +1,5 @@
#load "unix.cma";;
Unix.unlink "input.txt";;
Unix.unlink "/input.txt";;
Unix.rmdir "docs";;
Unix.rmdir "/docs";;

View file

@ -0,0 +1,13 @@
use IO;
bundle Default {
class FileExample {
function : Main(args : String[]) ~ Nil {
File->Delete("output.txt");
File->Delete("/output.txt");
Directory->Delete("docs");
Directory->Delete("/docs");
}
}
}

View file

@ -0,0 +1,13 @@
NSFileManager *fm = [NSFileManager defaultManager];
// Pre-OS X 10.5
[fm removeFileAtPath:@"input.txt" handler:nil];
[fm removeFileAtPath:@"/input.txt" handler:nil];
[fm removeFileAtPath:@"docs" handler:nil];
[fm removeFileAtPath:@"/docs" handler:nil];
// OS X 10.5+
[fm removeItemAtPath:@"input.txt" error:NULL];
[fm removeItemAtPath:@"/input.txt" error:NULL];
[fm removeItemAtPath:@"docs" error:NULL];
[fm removeItemAtPath:@"/docs" error:NULL];

View file

@ -0,0 +1,6 @@
for Dir in ["/" "./"] do
try {OS.unlink Dir#"output.txt"}
catch _ then {System.showInfo "File does not exist."} end
try {OS.rmDir Dir#"docs"}
catch _ then {System.showInfo "Directory does not exist."} end
end

View file

@ -0,0 +1,4 @@
system("rm -rf docs");
system("rm input.txt");
system("rm -rf /docs");
system("rm /input.txt");

View file

@ -0,0 +1,4 @@
unlink 'input.txt';
unlink '/input.txt';
rmdir 'docs';
rmdir '/docs';

View file

@ -0,0 +1,6 @@
int main(){
rm("input.txt");
rm("/input.txt");
rm("docs");
rm("/docs");
}

View file

@ -0,0 +1,6 @@
# possible aliases for Remove-Item: rm, del, ri
Remove-Item input.txt
Remove-Item \input.txt # file system root
Remove-Item -Recurse docs # recurse for deleting folders including content
Remove-Item -Recurse \docs

View file

@ -0,0 +1 @@
deletedirectory docs

View file

@ -0,0 +1,6 @@
DeleteFile("input.txt")
DeleteDirectory("docs","") ; needs to delete all included files
DeleteFile("/input.txt")
DeleteDirectory("/docs","*.*") ; deletes all files according to a pattern
DeleteDirectory("/docs","",#PB_FileSystem_Recursive) ; deletes all files and directories recursive

View file

@ -0,0 +1,7 @@
; Local.
delete %input.txt
delete-dir %docs/
; Root.
delete %/input.txt
delete-dir %/docs/

View file

@ -0,0 +1,4 @@
'input.txt' delete
'/input.txt' delete
'docs' rmdir
'/docs' rmdir

View file

@ -0,0 +1,3 @@
with files'
"input.txt" delete
"/input.txt" delete

View file

@ -0,0 +1,7 @@
'------ delete input.txt ----------------
kill "input.txt" ' this is where we are
kill "/input.txt" ' this is the root
' ---- delete directory docs ----------
result = rmdir("Docs") ' directory where we are
result = rmdir("/Docs") ' root directory

View file

@ -0,0 +1,4 @@
(File newNamed: 'input.txt') delete.
(File newNamed: '/input.txt') delete.
(Directory newNamed: 'docs') delete.
(Directory newNamed: '/docs') delete.

View file

@ -0,0 +1,2 @@
(Directory current / 'input.txt') delete.
(Directory root / 'input.txt') delete.

View file

@ -0,0 +1,4 @@
OS.FileSys.remove "input.txt";
OS.FileSys.remove "/input.txt";
OS.FileSys.rmDir "docs";
OS.FileSys.rmDir "/docs";

View file

@ -0,0 +1,5 @@
$$ MODE TUSCRIPT
- delete file
SET status = DELETE ("input.txt")
- delete directory
SET status = DELETE ("docs",-std-)

View file

@ -0,0 +1,3 @@
needs shell
" docs" remove
" input.txt" remove

View file

@ -0,0 +1,4 @@
rm -rf docs
rm input.txt
rm -rf /docs
rm /input.txt

View file

@ -0,0 +1,21 @@
Set oFSO = CreateObject( "Scripting.FileSystemObject" )
oFSO.DeleteFile "input.txt"
oFSO.DeleteFolder "docs"
oFSO.DeleteFile "\input.txt"
oFSO.DeleteFolder "\docs"
'Using Delete on file and folder objects
dim fil, fld
set fil = oFSO.GetFile( "input.txt" )
fil.Delete
set fld = oFSO.GetFolder( "docs" )
fld.Delete
set fil = oFSO.GetFile( "\input.txt" )
fil.Delete
set fld = oFSO.GetFolder( "\docs" )
fld.Delete

View file

@ -0,0 +1,7 @@
// In current directory
File_Delete("input.txt", OK)
File_Rmdir("docs")
// In the root directory
File_Delete("/input.txt", OK)
File_Rmdir("/docs")

View file

@ -0,0 +1,12 @@
'Current Directory
IO.Directory.Delete("docs")
IO.Directory.Delete("docs", True) 'also delete files and sub-directories
IO.File.Delete("output.txt")
'Root
IO.Directory.Delete("\docs")
IO.File.Delete("\output.txt")
'Root, platform independent
IO.Directory.Delete(IO.Path.DirectorySeparatorChar & "docs")
IO.File.Delete(IO.Path.DirectorySeparatorChar & "output.txt")

View file

@ -0,0 +1,45 @@
;syscall numbers for readability. :]
%define sys_rmdir 40
%define sys_unlink 10
section .text
global _start
_start:
mov ebx, fn
mov eax, sys_unlink
int 0x80
test eax, eax
js _ragequit
mov ebx, dn
mov eax, sys_rmdir
int 0x80
mov ebx, rfn
mov eax, sys_unlink
int 0x80
cmp eax, 0
je _exit
_ragequit:
mov edx, err_len
mov ecx, err_msg
mov ebx, 4
mov eax ,1
int 0x80
_exit:
push 0x1
mov eax, 1
push eax
int 0x80
ret
section .data
fn db 'inutput.txt',0
rfn db '/input.txt',0
dn db 'doc',0
err_msg db "Something went wrong! :[",0xa
err_len equ $-err_msg

View file

@ -0,0 +1,4 @@
remove, "input.txt";
remove, "/input.txt";
rmdir, "docs";
rmdir, "/docs";