The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > 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 10:39 PM
Inter-process communication:pipes,doors,etc. adderek UNIX for Advanced & Expert Users 2 01-18-2008 05:39 PM
handling abnormal process termination mridula High Level Programming 4 01-16-2006 06:27 AM
file handling problem in perl...... vivekshankar UNIX for Dummies Questions & Answers 2 06-02-2005 09:23 PM
Inter Process Communication kamathanil High Level Programming 2 08-07-2001 07:32 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-12-2005
saurabhjain saurabhjain is offline
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
  #2 (permalink)  
Old 05-12-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
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.
  #3 (permalink)  
Old 05-12-2005
saurabhjain saurabhjain is offline
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.
  #4 (permalink)  
Old 05-12-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
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.
  #5 (permalink)  
Old 05-12-2005
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,802
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

Closed Thread

Bookmarks

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
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