#!/usr/local/bin/rune -x # limport "sys"; import "stdio"; int main(int ac, char **av) { Fs fs; if (fs.dup(1) < 0) stdio.stdout->format("Failed to dup fd 1\n"); else stdio.stdout->format("Succssfully dupped fd 1 to %d\n", fs.fd); fs.close(); if (fs.dup2(1, 55) < 0) stdio.stdout->format("Failed to dup2 fd 1\n"); else stdio.stdout->format("Succssfully dupped fd 1 to %d (55)\n", fs.fd); fs.close(); }