![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
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
|
|||
|
|||
|
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 |
|||
| Google The UNIX and Linux Forums |