Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

7
votes
1answer
729 views

file descriptors and /dev/fd

Are file descriptors unique across a process, or throughout the whole system. Because every file seems the use the same descriptor for stdin and stdout. Is there something special with these? How ...
12
votes
2answers
3k views

What happens when I close() a file descriptor?

I am trying to get the whole picture with file descriptors. Say I have process1 which initially has these file descriptors: _process1_ | | | 0 stdin | | 1 stdout | | 2 stderr | ...
4
votes
2answers
226 views

Emacs' file extension recognition

How do I get Emacs to recognize new file extensions? For example if I have a .c file and I open it in Emacs, I get the correct syntax highlighting for C, but if I have a .bob file format (which I know ...
8
votes
3answers
1k views

rewrite existing file so that it gets replaced by new version atomically, only once fully written

I vaguely recall reading somewhere that there used to be, in some Unices a way to open an existing file for writing, with a flag that asked the kernel to use the old version (for other processes ...
5
votes
0answers
102 views

How can different file descriptors point to the same file in open file table? [duplicate]

Possible Duplicate: How can same fd in different processes point to the same file? I have a hard time grasping the two ideas of File Descriptor Table and Open File Table. Open File Table ...
7
votes
3answers
3k views

How to remove Notepad from the applications list?

After installing Wine, Notepad has became a default application to open unknown textual files by double click. I'd like to eliminate this behaviour and remove Notepad from the list of applications ...
9
votes
3answers
31k views

Alternatives for “lsof” command?

In many cases "lsof" is not installed on the machines that with I have to work, but the "function" of lsof would be needed very much (ex. on AIX). :\ Are there any "lsof" like applications in the ...
5
votes
1answer
1k views

File descriptor limits are lost after a system reboot

I'm trying to increase the default file descriptor limits for processes on my system. Specifically I'm trying to get the limits to apply to the Condor daemon and its sub-processes when the machine ...
22
votes
2answers
5k views

Who's got the other end of this unix socketpair?

I want to determine what process has the other end of a unix socket, that was created with socketpair(). I have a program parent which creates a socketpair(AF_UNIX, SOCK_STREAM, 0, fds), and fork()s. ...
5
votes
2answers
185 views

How does bash continue to work correctly when you move its working directory?

On Linux, I moved a directory to another directory using mv, and in another shell, my working directory happened to be the directory that was moved. I ran hg pull in that shell, and to my surprise, ...
8
votes
2answers
4k views

See the STDOUT redirect of a running process

If I start an app with this command: /path/to/my/command >> /var/log/command.log And the command doesn't return, is there a way, from another prompt, to see what the STDOUT redirect is set ...
4
votes
3answers
1k views

Gedit opening an “Unsaved document” on opening files with mouse

When I open files by double-clicking a file with mouse I always get one additional "Unsaved Document X".. which is very annoying, because I have to close tham all, and click "Close without save" every ...
4
votes
2answers
1k views

What is the referent of a file descriptor?

My understanding is that a file descriptor is an integer which is a key in the kernel's per-process mapping to objects such as open()ed files, pipes, sockets, etc. Is there a proper, short, and ...
14
votes
2answers
6k views

/proc/PID/fd/X link number

In Linux, in /proc/PID/fd/X, the links for file descriptors that are pipes or sockets have a number, like: l-wx------ 1 user user 64 Mar 24 00:05 1 -> pipe:[6839] l-wx------ 1 user user 64 Mar 24 ...
14
votes
2answers
3k views

How do open files behave on linux systems?

I just renamed a log file to "foo.log.old", and assumed that the application will start writing a new logfile at "foo.log". I was surprised to discover that it tracked the logfile to its new name, and ...
4
votes
2answers
504 views

retrieving names of all open pdf files (in evince or otherwise)

I constantly have many PDF files open. These are usually downloaded using chrome and immediately opened using evince. I sometimes want to persist the state of all my open PDF files, so I could ...
1
vote
1answer
258 views

Release a port owned by third party application?

I have been consulted about any way to release a port owned by a third party application that is listening to it. Say the application uses sockets and is listening for an specific port the root now ...
5
votes
2answers
2k views

How do I tell a script to wait for a process to start accepting requests on a port?

I need a command that will wait for a process to start accepting requests on a specific port. Is there something in linux that does that? while (checkAlive -host localhost -port 13000 == false) ...
2
votes
1answer
193 views

Prevent libflashplayer.so from deleting a file?

I'm trying the preview release of Flash Player "Square" for Linux and noticed that video files are now being deleted from the /tmp/ folder. Yet the files are still in use (I can see them with lsof): ...
19
votes
4answers
6k views

How do I find out which processes are preventing unmounting of a device?

Sometimes, I would like to umount a usb device, but I get a drive is busy error. How do I find out which processes or programs are accessing the device?
9
votes
1answer
137 views

Strategies for maintaining a reference to a file after it was moved or renamed?

I've had a mac at work lately, and was amazed to see that Xcode would still find my latest project after I renamed its folder and moved it someplace else. Now I understand that this is the result of ...
14
votes
5answers
4k views

What is using this network socket?

I'm trying to use NTP to update the time on my machine. However, it gives me an error: host # ntpdate ntp1.example.org 10 Aug 12:38:50 ntpdate[7696]: the NTP socket is in use, exiting What does the ...
9
votes
6answers
2k views

How do I set a limit on the number of files Linux can have open?

I plan to run a Java app using nohup ... &. The limit must apply to commands like this.