Reading a file that is already open by another process


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Reading a file that is already open by another process
# 1  
Old 08-12-2008
Reading a file that is already open by another process

hi,

I'm using HP unix tru64 & Win XP.

i'm download a file from winxp to unix using ftp.

how to know whether a remote file is currently being used by the process or not? (my loaction unix server)
# 2  
Old 08-12-2008
Quote:
by the process
Which process?

"A remote file being in use by a process..." Sorry, I don't understand what you mean. Remote in the terms if you can check from your Unix box if the file you are downloading is currently in use by some process on the XP box Smilie Maybe you describe a bit more, what you want to know.

Basically on Unix you can check with "fuser" if files are in use.
# 3  
Old 08-12-2008
i have try explain below:

1. application1 create A1 file and write some text to A1 file.
application1 running windows server

2. application2 download A1 file from windows server to unix server.
application2 running unix server

problem is application1 writing text to A1 file(not finish) and this time try download application2 file A1.

application2 did download not complete A1 file.
# 4  
Old 08-12-2008
Ah ok, understood. We solved such issues usually by sending an ok-flag file, just an empty file, with some special name, that you check on the UNIX side and if it arrived as 2nd file, you know that the 1st file (your datafile) has completely arrived. At least if no error occured.
Don't forget to remove the ok-flag file when everything is done, so the next ftp can come ^^
# 5  
Old 08-12-2008
Thank you suggestion. your idea is could solve my problem.
I understood that app1 insert ok-flag file last line.
app2 check ok-flag than have ok-flag completely download file.
it's right?
# 6  
Old 08-12-2008
Nope:

1. ftp data file windows -> unix
2. after that ftp empty ok-file windows -> unix
3. check if ok file has been received on unix which signals that the data file transfer has already been made
4. start your processing of the data file

ok? Smilie
# 7  
Old 08-13-2008
Data

sorry, i don't understand.
what's mean "empty ok-file" ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. SCO

sco unix backward compatibility on "max open file per process"

Hi How to increase maximum number of open file in "sco xenix binary" running in "sco unix openserver 5.0.7" ? I have changed "NOFILES" kernel parameter to 512, but xenix binray can't open more than 60. tnx (4 Replies)
Discussion started by: javad1_maroofi
4 Replies

2. Shell Programming and Scripting

fatal: cannot open file `TNAME' for reading (No such file or directory)

Hi, I am running this command through a shell script and getting the error mentioned in the subject line: testing.awk -f x.txt TNAME My testing.awk file contains something like ++++++++++++++++++ #!/usr/bin/awk -f BEGIN{ TAB_NAME="INSERT_ONE_" ARGV ; } if ( $1=="JAM_ONE" &&... (1 Reply)
Discussion started by: kunwar
1 Replies

3. Red Hat

cannot set user id: Resource temporarily unavailable (not open file/open process related)

First post, sorry to be a bother but this one has been dogging me. I have a process user (java application server) that trips a resource limit every couple weeks and need help finding what limit we're hitting. First, this is what's running: This is the error when jobs are run or the... (0 Replies)
Discussion started by: Katahdin
0 Replies

4. Solaris

file open/read/write/close/access by process

Hi want to know what file (descriptor+filename+socket) is being accessed by particular process on solaris. Purpose : while running perf. test, needs to find where is the bottleneck. We are providing concurrnet load for around 1 hr and needs to capture data related to file usage pattern... (1 Reply)
Discussion started by: raxitsheth
1 Replies

5. Shell Programming and Scripting

Reading a file with while into variable and using in another process

I would appreciate some help, please. I have a file cutshellb.txt, which contains four report names (but it could be any number from 1 to x. The report suffix is not necessarily consecutive: report3785 report3786 report3787 report3788 I have a shell script which attempts to read the... (3 Replies)
Discussion started by: Dicloflex
3 Replies

6. Programming

reading process information

Can any one tell me is there any problem in reading the /proc/#/status file for finding out the exact process name..??? (4 Replies)
Discussion started by: clintoo
4 Replies

7. Shell Programming and Scripting

Monitor open file handles used by a process

We have a process that is running out of file handles. Is there some command line way to determine this that we can include into a cron script? Please let me know JAK (3 Replies)
Discussion started by: jakSun8
3 Replies

8. Shell Programming and Scripting

getting error 0403-016 Cannot find or open the file while reading a long line

Hi, I have an requirement of reading a long line of 7000 chars and cutting it iam doing this : while read -r x do echo $x ......... done < `cat filename` when iam doing this it is giving me "0403-016 Cannot find or open the file." Can anyone let how this can be done. (2 Replies)
Discussion started by: karthee
2 Replies

9. UNIX for Advanced & Expert Users

Max No of Open File Descriptors in a process

I have set the maximum no of file descriptors open in a process to the value 8192 using the following lines set rlim_fd_max=8192 set rlim_fd_cur=8192 in the /etc/system file. I rebooted the machine and the command ulimit -n / -Hn both display the limits as 8192. However when I run my... (2 Replies)
Discussion started by: lakshmankumar12
2 Replies

10. Programming

transfer an open file description between two process

How can I transfer an open file description between two process? (1 Reply)
Discussion started by: xu_wen_dong
1 Replies
Login or Register to Ask a Question