Questions tagged [file-descriptors]
The file-descriptors tag has no usage guidance.
37
questions
0
votes
1
answer
51
views
Is it guaranteed that a file descriptor will be created when a process accesses a file? Specifically in /proc/pid/fd
I am creating an ebpf program that has a tracepoint on the syscall read().
The purpose of the program is to count how many times a file is read.
My current method to trace this is as follows:
When ...
1
vote
0
answers
171
views
same fd in multiple epoll instances for seperate writing and reading threads
can we use the same fd in multiple epollfds? I mean one epoll instance for catching EPOLLIN, one epoll instance for catching EPOLLOUT.
for example:
int fd = ... // the file descriptor
int epoll_reader ...
0
votes
2
answers
326
views
Track from which computers a file has been saved
Is there any way to track from which computer (username) a certain file has been modified? From right click > Properties > Details you can see the creator of the file, but I would like to see ...
0
votes
1
answer
94
views
How to find reason of rising count of NGINX open descriptors?
From time to time on the production server rise count of NGINX open descriptors. After that queue of connections is filled up. Also CPU usage rise to the max.
This stops automatically after 1 minute. ...
1
vote
1
answer
658
views
I made a file descriptor and want the output on console (stdout) and this new fd - how?
I created a fd with exec and like to post the output on the new fd 3 and the stdout 1 - in my case the console.
I thought it's simple to concat this but wasn't able to find the correct syntax.
I ...
0
votes
0
answers
794
views
Safari tabs, NSPOSIXErrorDomain:24 and file descriptors
I have a serious problem with file descriptors and I have tried everything.
My laptop: MacBook Pro 13" 2018 with touchbar, i5, 16 Gb RAM, 512SSD. MacOS 11.3.1.
Recently Chrome just starts to ...
2
votes
1
answer
111
views
How to fix open file descriptors of a running process after device unplug?
I have a process running that reads/writes to a file on my nvme /nvmedisk/file.
My nvme disk failed for some reason and it disappeared from lsblk but was listed with lspci.
I manually rebound it echo ...
0
votes
1
answer
1k
views
rsync + failed on error with Bad file descriptor
usually we not have this issue so its very rare!
but today we got the following error when we are using rsync to copy files . when files - pkg_gh are with 1-3G size
the error is like this
Warning: ...
0
votes
0
answers
24
views
How to add more information to the details page of a file in Windows explorer
In my previous company, we were working with GIT, which uses hashing technology for identifying purposes. I remember that the commit hash of a file was present in the details of a file (open a file in ...
1
vote
1
answer
3k
views
Read console output without redirect or pipe
Is there a way to read a command’s console output without redirecting or piping its STDOUT/STDERR?
The problem with redirects or pipes is that some commands behave differently when their STDOUT and/or ...
1
vote
1
answer
206
views
"Upload" pipe as if it were a regular file
Suppose I want to tar and compress a file for upload to Google Drive or something, but all without ever saving an intermediate tarball (e.g. because of a lack of disk space and/or the disk is read-...
0
votes
0
answers
209
views
what is the right approach to count the open files
what is the real way to verify open files
what we do is that
lsof | sort | uniq >/tmp/file
so /tmp/file include all open files
and the number of open files can be identified by
wc -l /tmp/...
2
votes
0
answers
886
views
Cannot move file from Ext4 to exFAT if title contains colon (:)
I have a 1TB SSD that I've partitioned in half into Ext4/exFAT. The Ext4 is for better interop with Ubuntu 18.04 (my OS) and the exFAT is for better portability with other systems. I installed exfat-...
0
votes
0
answers
688
views
'Bad file descriptor', check disk found no errors
I copied two .MTS video files from an SD card to an external drive, over USB 3.0. One file was ok, the other did not get a thumbnail and attempting to access it bsplayer froze and could not be ...
0
votes
0
answers
83
views
tcsh closes file descriptors
I have a program that is being launched with a tcsh script. I would like to communicate with that process trough pipes (not named pipes) created by a parent process.
However, it looks like tcsh closes ...
2
votes
1
answer
2k
views
Why doesn't piping work for a command that expects stdin?
So, I was looking to take the output of unzip -Z1 into an array and found this answer; their first option, using mapfile and process substitution WITH input redirection, works a charm.
But then I ...
1
vote
1
answer
58
views
File descriptor opened once but closed many times; why the discrepancy?
I was trying to use process substitution and come across the following example:
exec 3>&1
tar cf /dev/fd/4 $directory_name 4>&1 >&3 3>&- | bzip2 -c > file.tar.bz2 3>&...
2
votes
1
answer
2k
views
I am having trouble understanding pipes and their implememnation in xv6
I am studying Operating Systems on my own from the MOOC lectures available online and wanted to work on xv6. I was reading the Documentation on xv6 and in chapter 0 when it is talked about pipes (pg. ...
2
votes
1
answer
4k
views
How to forcibly delete or close opened file?
Theoretical question. I have a network with 2 PC, running Windows. One PC is sharing a samba folder with video file, and i've opened up that file on second PC and started streaming video in infinite ...
2
votes
5
answers
196
views
Can we say that processes (with or without subprocesses) are totally reflected in their (descriptive) files?
Can we say that a whole "series" of files in a process (as represented respectively by file descriptors) directly reflect this process and possible sub processes of it, so that taking a respective ...
2
votes
2
answers
2k
views
Why lsof -p and just lsof return drastically different results?
I currently have set a open files limit of 100000 but lsof reports that it's close to running out.
Running lsof -n | awk '{print $2'} | sort | uniq -c | sort -n results in:
1 PID
90321 3979
...
1
vote
1
answer
119
views
UNIX redirecting to a file without writing permission system handling
I am learning the UNIX environment and have a question.. When it comes to redirecting a std error to a file, what happens if the file we redirect to has writing permissions denied to the user?
...
0
votes
0
answers
51
views
Tool to connect to a file descriptor for I/O
I'm looking for a unix tool which can connect me to a specific file descriptor and do some I/O operations on it, assuming that the user permissions are valid. What could I look to use?
4
votes
1
answer
1k
views
Output to a file using file descriptor
I was wondering if it's possible to redirect output of one process (in OS X/ Linux) to another process if I know the fd of another process. For example:
I open a file using vim: vim /tmp/test. This ...
3
votes
1
answer
4k
views
Other ways to increase max open files?
I have an application which keeps giving me the following error.
tail: inotify cannot be used, reverting to polling: Too many open files
I have already followed all the advice I've been able to find ...
-1
votes
1
answer
1k
views
change descriptor when renaming file linux [closed]
I got a programm in CentOS which writes its log to a file. When I rename it, the programm still writes to it. Is there a way to change that file descriptor without restarting the programm?
0
votes
1
answer
600
views
Number of max open files for a process stays low
I have a process running on a ubuntu under a user which its ulimit is 400000 for both -Hn and -Sn options.
The /etc/security/limits.conf value for that user is 100000.
However, when I execute cat /...
0
votes
0
answers
613
views
what are sane open file descriptor limits on linux?
Where can I get good guidance on sane values for open file descriptor limits on linux.
We have users asking for massive numbers as their limits and I am unsure of the impact of this and what should ...
0
votes
1
answer
66
views
Is it possible to apply special restrictions for a content of a directory?
I want restrict permissions to the content of a directory /abc/def/:
disable links (symbolic or hard)
limit the number of write permissions pointing to the same file (e.g. to 1, so only one process ...
1
vote
3
answers
6k
views
What is file descriptor 10?
What is file descriptor 10?
Real-world example (where standard output is ignored, standard error redirected to standard output and data from file descriptor 10 is redirected to standard output) that ...
0
votes
3
answers
2k
views
Find out what app is using a file under Windows [duplicate]
Possible Duplicate:
Windows 7: File In Use when deleting file
Sometimes I can't delete a file because it's being used by some unknown applications. How can I find out what apps?
0
votes
2
answers
226
views
An Application to describe .patch files
Do you know any application that be able to describe .patch files?
I mean an application that be able to get .patch file & give me a human readable of the changes it make on files so I'll be able ...
109
votes
7
answers
144k
views
Increase the maximum number of open file descriptors in Snow Leopard?
I am trying to do something that requires a large number of file descriptors
sudo ulimit -n 12288 is as high as Snow Leopard wants to go; beyond this results in
/usr/bin/ulimit: line 4: ulimit: ...
2
votes
1
answer
2k
views
ulimit soft limit for file descriptors - for a non-root user on CentOS 5.6
I am needing to increase the soft limit for "file descriptors", and make it effective for a non-root user (lets say user1).
Ran these commands, while logged in as user1:
>ulimit -a
core ...
26
votes
3
answers
12k
views
tail -f not tracking file changes
I was recently looking into using tail -f to monitor some text files like so: tail -f /var/sometext.
However, when I did some testing, it doesn't seem to work. What I did was I created a new file ...
0
votes
2
answers
272
views
How many file descriptors accessing a given file?
On linux, is there a way to count the number of file descriptors open to a some file?
4
votes
3
answers
7k
views
Meaning of FDSize in /proc/PID/status
I'm looking for a way to find out the open FD limit under Ubuntu machines which doesn't have the /proc/PID/limits, namely EC2 machines.
I have been looking into /proc/PID/limits, and found the the ...