Visit Our UNIX and Linux User Community

Inter Process File Handling Problem

Thread Tools Search this Thread
Operating Systems HP-UX Inter Process File Handling Problem
# 1  
Old 05-12-2005
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

# 2  
Old 05-12-2005
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  
Old 05-12-2005
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  
Old 05-12-2005
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  
Old 05-12-2005
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
HOST mv screwyfilename.txt goodfilename.txt

Previous Thread | Next Thread
Test Your Knowledge in Computers #146
Difficulty: Easy
In 1983, Richard Stallman announced the GNU (short for "GNU's Not Unix") project, to create a proprietary, commercial software Unix-like system.
True or False?

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Is orphan process handling by Solaris os and Linux os same?

In solaris, orphan process is put to sleep mode and does not consume any CPU resources. In Linux, orphan process is kept in running state consuming all CPU and Ram resources. Is it the case? Is there a difference on how these operating systems will handle orphan processes? The route cause of... (10 Replies)
Discussion started by: Belure Pooja B
10 Replies

2. Programming

help with write-read locks inter-process

I need help!Many Thanks! Now,I try to manage the shared memory inter-process . Inevitably,I have to deal with the synchronous. I know the pthread_rwlock in posix,and I compile ,then run successfully in Red Hat Enterprise 4. I have a doubt about whether the Posix supports the system such as... (1 Reply)
Discussion started by: weizh
1 Replies

3. Programming

problem in SIGSEGV signal handling

i wrote handler for sigsegv such that i can allocate memory for a variable to which sigsegv generated for illlegal acces of memory. my code is #include <signal.h> #include<stdio.h> #include<stdlib.h> #include<string.h> char *j; void segv_handler(int dummy) { j=(char *)malloc(10); ... (4 Replies)
Discussion started by: pavan6754
4 Replies

4. Programming

C program using IPC (inter process communication)

i want to write a C chat program that communicates over IPC(inter process communication), that could be run using 2 seperate terminal windows within the same computer. so that wat u type in one terminal window , should appear on the other and vice versa... could some one please help me with the... (2 Replies)
Discussion started by: localp
2 Replies

5. Programming

Problem with handling SIGINT

For a program I am designing, which involves handling the keyboard input Ctrl^c (SIGINT), it is taking ages for the program to actually recognise and perform the corresponding action whenever I run it and hit Ctrl^C at the CL. I have to do at least 3 Ctrl^Cs before the program will actually... (3 Replies)
Discussion started by: JamesGoh
3 Replies

6. UNIX for Advanced & Expert Users

Inter-process communication:pipes,doors,etc.

Hi, I am thinking about writing a log daemon for a multi-processed ksh application (yes - I know that high-level language would be a better option). My question is as follows: If many processes (many scripts) will try writing to a single log file: print "message" > common.log Will it work or... (2 Replies)
Discussion started by: adderek
2 Replies

7. Programming

handling abnormal process termination

hi i m writin a program in which i keep track of all the child processes the program has generated and if a child process has an abnormal termination i need to do certain task related to that child process. for handlin child process i used waitpid: temp_cpid=waitpid(-1,&stat,WUNTRACED); ... (4 Replies)
Discussion started by: mridula
4 Replies

8. UNIX for Dummies Questions & Answers

file handling problem in perl......

Hi, I am opening a file......then i am wrting some data into it......and i am reopening the file again but ......i get a error cannot open file....... $::file= "\adder\testfile.txt" open(TEST1,$::file); some write operation close(TEST1) open(TEST1,$::file) 'I GET A ERROR CAN OPEN... (2 Replies)
Discussion started by: vivekshankar
2 Replies

9. Programming

Inter Process Communication

unix IPC i would like to know the method of usage of semaphores on shared memory segments the topic seems very difficult to understand mainly when difrent proceses communicate instantly and how do i avaoid deadlock situation (2 Replies)
Discussion started by: kamathanil
2 Replies

Featured Tech Videos