Discussion about this post

User's avatar
John Dougan's avatar

A little known bit of NT history:

https://www.techmonitor.ai/technology/dec_forced_microsoft_into_alliance_with_legal_threat

NT comes from VMS & MICA (and RSX-11, etc.), as Unix comes from Multics. Except, of course, Dennis, Brian and Ken didn't steal source.

Expand full comment
dextius's avatar

> Try to wait for I/O and process completion on a Unix system at once; it’s painful.

Oh yeah, super painful.. hmmph..

#!/usr/bin/env perl

use strict;

use Data::Dumper;

use IO::Select;

use IO::File;

my $sel = new IO::Select();

my %files;

my $pid = open(my $fh, "ls -al 2>&1 |");

$files{$fh} = "ls -al";

$sel->add($fh);

foreach my $arg ( @ARGV ) {

die("File not found $arg") unless ( -e $arg );

my $ff = new IO::File($arg);

$files{$ff} = $arg;

$sel->add($ff);

}

while ( 1 ) {

foreach my $fh ( $sel->can_read(1) ) {

my $buf;

sysread($fh, $buf, 20_000, length($buf));

if ( $buf ) {

print "$files{$fh} $buf\n";

} else {

print "Handle closed: $files{$fh}\n";

}

}

sleep(1);

}

Expand full comment
11 more comments...

No posts