The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Monitor open file handles used by a process jakSun8 Shell Programming and Scripting 3 07-15-2008 10:25 AM
getting error 0403-016 Cannot find or open the file while reading a long line karthee Shell Programming and Scripting 2 06-05-2005 12:00 AM
Max No of Open File Descriptors in a process lakshmankumar12 UNIX for Advanced & Expert Users 2 12-29-2004 11:54 PM
Reading a process control block hmurali High Level Programming 2 06-03-2002 01:53 AM
transfer an open file description between two process xu_wen_dong High Level Programming 1 01-17-2002 03:00 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-12-2008
Tlg13team Tlg13team is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 27
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 (permalink)  
Old 08-12-2008
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,257
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 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 (permalink)  
Old 08-12-2008
Tlg13team Tlg13team is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 27
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 (permalink)  
Old 08-12-2008
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,257
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 (permalink)  
Old 08-12-2008
Tlg13team Tlg13team is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 27
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 (permalink)  
Old 08-12-2008
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,257
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?
  #7 (permalink)  
Old 08-13-2008
Tlg13team Tlg13team is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 27
Unhappy

sorry, i don't understand.
what's mean "empty ok-file" ?
Sponsored Links
Closed Thread

Bookmarks

Tags
unix download

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:40 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0