Family Day update

This commit is contained in:
Ingy döt Net 2020-02-17 23:21:07 -08:00
parent aac6731f2c
commit 9ad63ea473
2442 changed files with 39761 additions and 8255 deletions

View file

@ -0,0 +1,12 @@
package rosetta;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
public class UnixLS {
public static void main(String[] args) throws IOException {
Files.list(Path.of("")).sorted().forEach(System.out::println);
}
}

View file

@ -0,0 +1 @@
Files.list(Path.of("")).map(Path::toString).sorted(String.CASE_INSENSITIVE_ORDER).forEach(System.out::println);

View file

@ -1,22 +0,0 @@
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

@ -1,4 +1,6 @@
import os
from algorithm import sorted
from os import walkPattern
from sequtils import toSeq
for kind, path in walkDir(getCurrentDir(), true):
for path in toSeq(walkPattern("*")).sorted:
echo path

View file

@ -0,0 +1,12 @@
class Test {
function : Main(args : String[]) ~ Nil {
file_names := System.IO.File.Directory->List(".");
each(i : file_names) {
file_name := file_names[i];
if(System.IO.File.Directory->Exists(file_name)) {
file_name += '/';
};
file_name->PrintLine();
};
}
}

View file

@ -0,0 +1,2 @@
foreach(get_dir(), string file)
write(file +"\n");

2
Task/Unix-ls/R/unix-ls.r Normal file
View file

@ -0,0 +1,2 @@
cat(paste(list.files(), collapse = "\n"), "\n")
cat(paste(list.files("bar"), collapse = "\n"), "\n")