dup Questions
5
Solved
In this C program
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
int main()
{
int file = open("Result", O_CREAT|O_WRONLY, S_IRWXU)...
4
Solved
I am writing some tests using Test::More, and one of the functions I'm testing prints to STDERR. I'd like to test the output to STDERR, but am a little unsure how to do this. I know I'm close. This...
4
Solved
3
Solved
2
Solved
I am stuck in this error for quite sometime now and have hit a dead end.
I get this totally unhelpful error
can't dup NilClass
This is the situation.
I have one class which is in a relationsh...
Wadley asked 19/7, 2010 at 6:17
6
Solved
The Ruby docs for dup say:
In general, clone and dup may have different semantics in descendent classes. While clone is used to duplicate an object, including its internal state, dup typically u...
8
Solved
I know that dup, dup2, dup3 "create a copy of the file descriptor oldfd"(from man pages). However I can't digest it.
As I know file descriptors are just numbers to keep track of file locations and...
5
Solved
I know what dup / dup2 does, but I have no idea when it would be used.
Any practical examples?
Schlimazel asked 12/11, 2009 at 7:33
2
Solved
I'm working on a linux C project and I'm having trouble working with file descriptors.
I have an orphan file descriptor (the file was open()'d then unlink()'d but the fd is still good) that has wr...
5
Solved
I have a hash like:
h = {'name' => 'sayuj',
'age' => 22,
'project' => {'project_name' => 'abc',
'duration' => 'prq'}}
I need a dup of this hash, the change should not affect...
Tymes asked 3/1, 2012 at 10:12
6
Solved
3
Solved
I have an object of a class, and I want to duplicate it with dup. One of the instance variables is an array, and it seems to be referencing it. I thought dup actually created a DUPLICATE.
Here's m...
2
Solved
Can I get a really dumbed down explanation of the dup() function when it comes for duplicating file descriptors?
I want to use pipe, but I have to also make the child to read from pipe(this is the ...
2
Solved
What's the difference between Ruby's dup and clone methods? describes the difference in the behavior of dup and clone. But when should I use dup, and when should I use clone instead?
Examp...
1
Currently I'm coding a small shell (redirection, pipes, exec, etc.). Been trying to figure out the steps the Linux shell takes in addressing I/O redirection.
Some questions on what I need help on:...
Faline asked 26/11, 2013 at 11:8
1
Solved
I have an assignment I'm working on and I'm having difficulty finishing it. The idea is to write a program if.c that executes one program and if that succeeds it executes the second program. I'm su...
1
Solved
I have a Pointer class with a single attribute :contents, that points to an object of class MyObject.
class MyObject
def hello; "hello" end
end
class Pointer
attr_reader :contents
def initiali...
1
1
Solved
This is a follow up question from here.
Where I want do go
I would like to be able to temporarily redirect the stdout into a temp file, while python still is able to print to stdout. This would in...
Tswana asked 11/1, 2012 at 10:50
3
Solved
This is a follow up question from here specifically concerning its answer.
From a python module I am calling a Hello World executable that simply prints Hello World to the stdout. I am intereste...
Copaiba asked 10/1, 2012 at 14:32
1
© 2022 - 2024 — McMap. All rights reserved.