You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

21 lines
363 B

var filename = ARGV[2];
function cat (file) {
file.read(100, function (status, data) {
if (status == 0 && data) {
stdout.write(data.encodeUtf8());
cat(file);
} else {
file.close();
}
});
}
var f = new File;
f.open(filename, "r", function (status) {
puts("open!");
if (status == 0)
cat(f);
else
puts("error?");
})