Skip to content
Advertisement

Tag: descriptor

Linux file descriptor – getting current redirection stdout file?

I’m trying to get the current stdout redirection, and having some trouble. I have a script that is always run with stdout redirection ie: In myscript.sh, I need to find out what file it is being output to. I’m trying this currently (not working): That’s outputting logfile = /tmp/sflq.r3f, for instance. I need to instead find that it’s going to

link count and ls command

I’m learning file link count. Only when link count reaches 0 can file’s contents be deleted. In my test the process opens a file in directory “/home/hel/myfile” and sleep 10(s). At the same time I delete it using “rm /home/hel/myfile”. Then I use command “ls” and display No such file. But in fact, the file still exists because the fd

Advertisement