include "sys.m"; sys := load Sys Sys->PATH; dup: fn(oldfd, newfd: int): int; fildes: fn(fd: int): ref FD;
The dup call takes a valid integer file descriptor, oldfd, referring to an open file, and returns a new integer file descriptor referring to the same file. If newfd is in the range of legal file descriptors, dup will use that for the new file descriptor (closing any old file associated with newfd); if newfd is -1 the system chooses the lowest available file descriptor. If a suitable file descriptor cannot be found, dup returns -1.
Fildes uses the integer file descriptor fd to create a new Limbo file descriptor, suitable for other Sys module functions. It returns nil if it cannot convert fd.
SYS-DUP(2 ) | Rev: Thu Feb 15 14:43:27 GMT 2007 |