Number of open files (Dir's) how to close?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Number of open files (Dir's) how to close?
# 1  
Old 11-07-2008
Number of open files (Dir's) how to close?

I am having a client/server application which will download files from server. If server has directories, it will create directories/sub directories and then download files. In this process, I observed that number of open files are more than 400 (which is approxmately same as number of dir/subdir that I downloaded from server) using "lsof -p pid" command. The o/p of lsof command has "DIR" Type files with file descriptor as "Read".
I did't understand why the Type "DIR" is in read mode. Under what conditions it will take place?
# 2  
Old 11-07-2008
Just about anytime the directory is being read -- possibly by lsof itself. It can also be in read mode if there is a process that set its current working directory (setcwd()) to that directory. It might also be becuase a process opened the directory for reading, but never bothered to close it, and that this process is still running. (A buggy FTP server perhaps?)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to get value from a close and open parenthesis?

Hi Gurus, I have an input like the one below. What i wanted to achieved is to create a select statement based from that information INPUTInsert into table_name (col1,col2,col3,col4,col5,DATE1,DATE2,col6,col7,col8,col9,col10,col11) values (6752,14932156,24,'ALL','Staff',to_date('04/17/2017... (6 Replies)
Discussion started by: ernesto
6 Replies

2. Programming

How to open DIR (with nisted DIR) using C?

by c code if I want to open directory that is come after name of excuted file for example: ./open dir1 it go to dir1 and open it and read every thing insde it...... ... and other problem is how I should read every directory inside that directory and open it to read it and so on? (4 Replies)
Discussion started by: fwrlfo
4 Replies

3. IP Networking

Open/close of ports

Hi, I have read some forum theads about the open and close ports. some points are clear and it is not working on my machine or something am i missing? I have commented out a port /etc/services, one application uses then when i use the telnet <hostname> <port_blocked> it shows connected..... (1 Reply)
Discussion started by: balamv
1 Replies

4. Shell Programming and Scripting

Find the number of files older than 1 day from a dir

Hello All, I need to write a script/command which can find out the number of .csv files residing in a directory older than 1 day. The output should come with datewise (means for each date how many files are there). I've this command, but this command gives the total number of files. It's... (10 Replies)
Discussion started by: NARESH1302
10 Replies

5. Windows & DOS: Issues & Discussions

Can DOS close an open file?

I'm trying to setup a cron job for my brother that goes out to the web and retrieves an excel file and overwrites the existing copy on his desktop. The problem I'm facing is I have to kill the process (excel.exe) if the file is open while the batch file runs, otherwise, it will create another copy... (2 Replies)
Discussion started by: quattro20v
2 Replies

6. Shell Programming and Scripting

Checking for proper number of files in dir

Using Solaris 10 and sh. I have three files. mydirs.txt /dir1/dir2/dir3 /dir4/dir5/dir6 mydirshave.txt 1 2 mydirsshouldhave.txt 2 2 For each directory listed in mydirs.txt I should have the number of files equal to mydirshouldhave.txt. But using -ls |wc -l- on the dirs I get what... (2 Replies)
Discussion started by: crowman
2 Replies

7. Solaris

close open files before remove

Hi I have a script to remove log files when it reaches %70 usage in order to descending order of dates. But sometimes it happens to remove open - being processes files , so makes them unlinked from the directors and results them disappeared. How can I solve this problem , simple scenario I... (9 Replies)
Discussion started by: xramm
9 Replies

8. UNIX for Dummies Questions & Answers

Should a UNIX daemon process close open fds?

I have a UNIX daemon process that's been started by a parent process, an application server. The behavior of this daemon process is to inherit and use the app server's file descriptors (ports/sockets). When I shutdown the app server, the daemon continues to run, because there may be other... (1 Reply)
Discussion started by: kunalashar
1 Replies

9. UNIX for Advanced & Expert Users

finding the number of open files

Hi!! Is there any way to find the number of open files at any time on the server?? I am on HP -UX-11 :confused: (1 Reply)
Discussion started by: jyotipg
1 Replies

10. UNIX for Dummies Questions & Answers

File status - open/close ??

Is there any commands in UNIX, like isopen(),isclose() to know whether a file has been opened for read/write purpose.? Thanks (3 Replies)
Discussion started by: Pal
3 Replies
Login or Register to Ask a Question