file-descriptor Questions

5

Solved

Having the following structure: - project1 - project1.py - protofile_pb2.py - protofile_pb2_grpc.py - project2 - project2.py - protofile_pb2.py - protofile_pb2_grpc.py project1.py: import...
Seanseana asked 13/6, 2018 at 14:24

2

Solved

Looking at the man page for fopen I cannot get a definite answer to this question. FILE *fopen(const char *path, const char *mode); I understand that fopen returns a file pointer to a stream but i...
Bordiuk asked 9/3, 2012 at 23:37

3

MediaStore.MediaColumns.DATA constant was deprecated in API level Q. Apps may not have filesystem permissions to directly access this path. Instead of trying to open this path directly, apps shoul...
Komsomol asked 22/4, 2019 at 14:43

7

Solved

If for some reason, I discover a fatal situation in my program, and I would like to exit with an error code. Sometimes, the context of the fatal error is outside the scope of other file-descr...
Osterman asked 6/3, 2013 at 12:1

3

Solved

In C pseudo-code: while (1) { fifo = open("fifo", O_RDONLY | O_NONBLOCK); fd_set read; FD_SET(fifo, &read); select(nfds, &read, NULL, NULL, NULL); } The process sleeps as triggered b...
Anapest asked 30/1, 2013 at 0:11

5

Solved

I am interested to know the valid values which I can expect for a file descriptor. Please let me explain a bit. I know that, for instance, when I use #include <unistd.h> on my linux system t...
Nonperformance asked 29/8, 2013 at 9:27

4

I'm learning about file descriptors and I wrote this code: #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <fcntl.h> int fdrd, fdwr, fdwt; char c; mai...
Bromberg asked 5/6, 2011 at 19:57

3

Solved

If I reload my application (from the browser with the reload button) a lots of times like 50 reload/10 seconds it gives me this error: events.js:45 throw arguments[1]; // Unhandled 'error' event ...
Oshinski asked 14/7, 2011 at 4:39

3

Solved

I'm using the following command to get a list of pipes: lsof | grep PIPE I want to know what the values of the FD column mean (the 5th one https://i.sstatic.net/zkjCn.png). I think that r and w...
Assumpsit asked 5/8, 2014 at 14:1

4

Solved

I want to use a bash variable to indicate a file descriptor, like this: id=6 file=a exec $id<>$file But the usage is wrong: -bash: exec: 6: not found So, how to use a variable to indica...
Kenishakenison asked 28/11, 2011 at 12:36

8

Solved

I'm basically looking for a C++ version of fdopen(). I did a bit of research on this and it is one of those things that seems like it should be easy, but turns out to be very complicated. Am I miss...
Alyse asked 30/4, 2010 at 16:43

3

Solved

I was a little confused by this expression: gcc -c -g program.c >& compiler.txt I know &>filename will redirect both stdout and stderr to file filename. But in this case the ampersan...
Recognize asked 29/6, 2012 at 2:48

13

Solved

What would be a more simplified description of file descriptors compared to Wikipedia's? Why are they required? Say, take shell processes as an example and how does it apply for it? Does a process...
Reach asked 10/3, 2011 at 7:17

2

Solved

I am implementing I/O redirection in a shell written in Rust. I succeeded in piping between two children processes by using unsafe code with raw file descriptors and pipe() from the libc crate. Wh...
Penick asked 10/3, 2017 at 19:15

3

Solved

I am using a scientific software including a Python script that is calling os.system() which is used to run another scientific program. While the subprocess is running, Python at some point prints ...
Onstad asked 7/10, 2011 at 10:54

8

Solved

I'm wondering if there's an easy way to iterate through a fd_set? The reason I want to do this is to not having to loop through all connected sockets, since select() alters these fd_sets to only in...
Chance asked 7/9, 2010 at 17:56

4

Solved

I know this question seems typical and multiple times answered but I think if you read the details it is not so common (I did not find it). The point is that I am developing a unix service in c th...
Toleration asked 9/12, 2013 at 13:40

8

Solved

Is it possible to get the filename of a file descriptor (Linux) in C?
Propagandize asked 27/7, 2009 at 15:14

2

Solved

I came across this reverse shell code, that is written in c. main(){ int sock = socket(AF_INET, SOCK_STREAM, 0); struct sockaddr_in sock_addr; sock_addr.sin_family = AF_INET; sock_addr.sin_por...
Phlebotomy asked 26/10, 2021 at 17:38

2

Solved

I feel like this is a topic I've taken for granted. In the past I literally just closed as many file descriptors "because I was told to". Most of the time this worked, but occasionally I ran into s...
Chaddie asked 20/4, 2019 at 7:59

5

Solved

Clarified There are two questions indeed. Updated to make this clearer. I have: t = { 'fd': open("filename", 'r') } I understand that del t['fd'] removes the key and closes the file. Is...
Idette asked 19/11, 2021 at 10:2

6

Solved

Is there a portable way (POSIX) to get the highest allocated file descriptor number for the current process? I know that there's a nice way to get the number on AIX, for example, but I'm looking f...
Bobsledding asked 22/5, 2009 at 17:35

0

Background A while ago I wrote a Raku module to test out some ideas I had for making external process pipelines (e.g., grep raku | wc -l). I followed the traditional way of creating Pipes and setti...
Whosoever asked 16/3, 2021 at 0:48

9

Solved

I would like to get a list of open files in a process on os x (10.9.1). In Linux I was able to get this from /proc/PID/fd. However I'm not sure how to get the same on OS X. I found that the procfs ...
Erective asked 7/1, 2014 at 14:40

3

I understand file descriptors are kernel handle to identify the file , while inode number of a file is pointer to a structure which has other details about file(Correct me if I am wrong). But I am ...
Georg asked 13/9, 2014 at 2:19

© 2022 - 2024 — McMap. All rights reserved.