How do I get filepair() to work? What am I doing wrong?
I'm running unicon-10.0-1 installed from an RPM on Linux Mandrake 8.1
[unicon@xmi-serve unicon]$ ./filepair
write read f[2] failed
[unicon@xmi-serve unicon]$ cat filepair.icn
procedure main()
if f:= filepair() then {
( pid := fork() ) | stop("fork failed")
if pid == 0 then {
close( f[2] ) | stop("close f[2] failed")
(f := f[1] ) | stop( "f := f[1] failed")
write(f, "hello world") | stop( " write f[1] failed " )
write
} else {
close( f[1] ) | stop("close f[1] failed")
f := f[2] | stop( "f := f[2] failed")
write(read(f)) | stop( " write read f[2] failed " )
}
} else {
stop( "filepair() failed" )
}
end
_______________________________________________
Unicon-group mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unicon-group