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

@ -0,0 +1,18 @@
' Emulate ls
cnt% = 0
files$ = ""
OPEN CURDIR$ FOR DIRECTORY AS mydir
GETFILE myfile$ FROM mydir
WHILE ISTRUE(LEN(myfile$))
IF LEFT$(myfile$, 1) != "." THEN
INCR cnt%
files$ = APPEND$(files$, cnt%, UNFLATTEN$(myfile$))
ENDIF
GETFILE myfile$ FROM mydir
WEND
CLOSE DIRECTORY mydir
IF cnt% > 0 THEN
FOR f$ IN SORT$(files$)
PRINT FLATTEN$(f$)
NEXT
ENDIF

View file

@ -0,0 +1,6 @@
Public Sub Main()
Dim sDir As String[] = Dir(User.Home &/ "test").Sort()
Print sDir.Join(gb.NewLine)
End

View file

@ -0,0 +1,22 @@
package rosetta;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class UnixLS {
public static void main(String[] args) throws IOException {
UnixLS ls = new UnixLS();
ls.list(System.out);
}
private void list(PrintStream out) throws IOException {
try (DirectoryStream<Path> stream = Files.newDirectoryStream(Paths.get("."))) {
stream.forEach((path) -> out.println(path.getFileName()));
}
}
}

View file

@ -0,0 +1,2 @@
const fs = require('fs');
fs.readdir('.', (err, names) => names.sort().map( name => console.log(name) ));

View file

@ -0,0 +1,9 @@
# v0.6.0
for e in readdir() # Current directory
println(e)
end
# Same for...
readdir("~") # Read home directory
readdir("~/documents")

View file

@ -0,0 +1 @@
pp(dir("."),{pp_Nest,1})

View file

@ -0,0 +1,4 @@
. dir *.dta
6.3k 6/12/17 14:26 auto.dta
2.3k 8/10/17 7:34 titanium.dta
6.0k 8/12/17 9:28 trend.dta

View file

@ -0,0 +1 @@
File.glob("*").sort()

View file

@ -0,0 +1 @@
File.glob("*",0x8).sort()

View file

@ -0,0 +1 @@
File.globular("Src",*,True,0x10,List).sort().concat("\n")