The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem with handling SIGINT JamesGoh High Level Programming 3 02-24-2008 07:39 PM
Inter-process communication:pipes,doors,etc. adderek UNIX for Advanced & Expert Users 2 01-18-2008 02:39 PM
handling abnormal process termination mridula High Level Programming 4 01-16-2006 03:27 AM
file handling problem in perl...... vivekshankar UNIX for Dummies Questions & Answers 2 06-02-2005 05:23 PM
Inter Process Communication kamathanil High Level Programming 2 08-07-2001 03:32 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-11-2005
Registered User
 

Join Date: Mar 2005
Posts: 2
Inter Process File Handling Problem

Hi All,

i am running a oracle procedure which writes a file . The same file is picked up by another script which runs in a cron after every 5 minutes.

Now the problem is that sometimes my script picks up a file while the procedure is still writing data in the file.

is there is any way i can lock my file, so that no other process process a file while one is still processin the file.

Thanx in advance

Saurabh
Reply With Quote
Forum Sponsor
  #2  
Old 05-12-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
Write the file with some screwy name that the cron script will not be looking for. After the oracle procedure finishes writing the file, rename the file to the proper name.
Reply With Quote
  #3  
Old 05-12-2005
Registered User
 

Join Date: Mar 2005
Posts: 2
In this case i have to create another script to rename the file first. and how will i detect the screwy name file has been completly written before renaming it.
Reply With Quote
  #4  
Old 05-12-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
Write a script with two lines. First line: oracle procedure. Second line: rename file. Somehow you will need to modify the oracle procedure to write to the screwy name. Can't do that? Then the current name is now the screwy name. Rename it to something else. And modify your other script to now look for the new name.
Reply With Quote
  #5  
Old 05-12-2005
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
spool in sql scripts writes files, unless you call UTL_FILE. In either event you can name an output file anything you want.

In an Oracle sql script the HOST command lets you execute a shell command like
Code:
HOST mv screwyfilename.txt goodfilename.txt
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:03 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0