June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

9
Task/Fork/D/fork.d Normal file
View file

@ -0,0 +1,9 @@
import core.thread;
import std.stdio;
void main() {
new Thread({
writeln("Spawned thread.");
}).start;
writeln("Main thread.");
}

View file

@ -0,0 +1,26 @@
// version 1.1.51
import java.io.InputStreamReader
import java.io.BufferedReader
import java.io.IOException
fun main(args: Array<String>) {
try {
val pb = ProcessBuilder()
val currentUser = pb.environment().get("USER")
val command = listOf("ps", "-f", "U", currentUser)
pb.command(command)
val proc = pb.start()
val isr = InputStreamReader(proc.inputStream)
val br = BufferedReader(isr)
var line: String? = "Output of running $command is:"
while(true) {
println(line)
line = br.readLine()
if (line == null) break
}
}
catch (iox: IOException) {
iox.printStackTrace()
}
}