Sponsored Content
Top Forums UNIX for Advanced & Expert Users Which process has created a file ? Post 302601313 by Corona688 on Thursday 23rd of February 2012 10:40:10 AM
Old 02-23-2012
Quote:
Originally Posted by 14341
Hi All,

We have a multi-threaded application.

During the course of action, each process creates some files.
Which? Is it multiple threaded, or multi-processing? Or perhaps both?
Quote:
Is there any way to know which process has created a particular file ?
This only works for processes, not threads, but you could run each instance under a different user id. The resulting files would belong to the corresponding user.

---------- Post updated at 09:40 AM ---------- Previous update was at 09:37 AM ----------

Otherwise, I would have the threads use better names for the files... Instead of file1 file2 file3 file4, file-<threadid1>, file-<threadid2>, file-<threadid3>, file-<threadid4>. The name itself will tell you what you need to know.
 

10 More Discussions You Might Find Interesting

1. Programming

Reference Variables To A Child Process Created With Fork

Hi! IN THE FOLLOWING PROGRAM THE VALUE OF j REMAINS UNCHANGED . WHY ? IF I WANT A VARIABLE VALUE TO CHANGE LIKE THIS , IS THERE ANY WAY TO DO IT ? Or do we have to use shared memory variables? main() { int return_pid, i, total; int j=1; total = TOTALRECS+1; for... (2 Replies)
Discussion started by: AJAY BHATIA
2 Replies

2. Shell Programming and Scripting

Need to process files created an hour ago

Hello all, I would like to ask for an advice on how to deal with the following scenario. Every now and then, our ERP system creates an interface text file with the following file format - XORD????.DLD where ???? is a sequence number. We can have 1 or more XORD files created in an hour. ... (9 Replies)
Discussion started by: negixx
9 Replies

3. Shell Programming and Scripting

How to empty a file(already created)

What is the command to empty an already existing file. please provide me.i used Touch cmd to empty the file.but it changing the time only. (4 Replies)
Discussion started by: laknar
4 Replies

4. UNIX for Dummies Questions & Answers

How to know when a new file is created?

Hi All, How to we get to know when say a new log file is created on an Unix box. I need to trigger a process(say a script) when the new log file is created. But i need to know by some means or generate a trigger when a new file is created???? Something like when we receive a new mail we... (1 Reply)
Discussion started by: aixjadoo
1 Replies

5. Homework & Coursework Questions

how to delete core file (file created due to apps crashed)

1. The problem statement, all variables and given/known data: When looking for corefiles, include any file with core in its name. (Some UNIX/Linux systems add the PID of the process that created the core to reduce the chances of overwriting an already existing core file that might be needed. The... (6 Replies)
Discussion started by: s3270226
6 Replies

6. Infrastructure Monitoring

JFFNMS: RRD files for imterface id 2190 has not been created by the Poller Process yet

hi, When we tried to add host in jffnms and marked all interfaces, it worked well with newly added hosts for linux. However if its solaris, we cannot see CPU interface. The error in the graph is RRD files for interface id 2190 has not been created by the Poller Process yet. Pls advise. ... (0 Replies)
Discussion started by: lhareigh890
0 Replies

7. UNIX for Dummies Questions & Answers

Who created a file?

Hi!Can somebody tell me what command can I use to find who created a file,please? (6 Replies)
Discussion started by: teotrask
6 Replies

8. Shell Programming and Scripting

Changing file permissions of a file created by another user

Hi, I have used expdp for datapump. The .dmp file is created by the "oracle" user. my requirement is to make a zipped file of this .dmp file. What i am trying to do is change the permissions of this .dmp file from 0640 to 0644 and then do a gzip and zip it. Is there any way i can change... (3 Replies)
Discussion started by: qwertyu
3 Replies

9. Shell Programming and Scripting

File not getting created

hi, i have a script wrriten where there is a temporary files getting created: echo "From:" ${usrname}@apps.mc.xerox.com>mail_txt it was working from a long time but now there is a error creating while creating this temporary file. here is the error log for this:... (15 Replies)
Discussion started by: lovelysethii
15 Replies

10. Shell Programming and Scripting

Shell script replied multiple process for file has successfully created

Hi All, I have written the following code do FILE_NO=$(echo $LINE|awk -F"|" '{print $1}'|tr "'" '+'|sed 's/\(.*\)\(++\)\(.*\)\(++\)/\3/') INST_NO=$(echo $LINE|awk -F"|" '{print $2}'|tr "'" '+'|sed 's/\(.*\)\(++\)\(.*\)\(++\)/\3/') if ] then ... (3 Replies)
Discussion started by: yogendra.barode
3 Replies
PTHREAD_MULTI_NP(3)					   BSD Library Functions Manual 				       PTHREAD_MULTI_NP(3)

NAME
pthread_multi_np, pthread_single_np -- switch between multi- and single-threaded scheduling modes LIBRARY
POSIX Threads Library (libpthread, -lpthread) SYNOPSIS
#include <pthread_np.h> int pthread_multi_np(void); int pthread_single_np(void); DESCRIPTION
The pthread_single_np() function switches the process to a single-threaded mode, i.e., suspends all threads except the current. The seman- tics of this function is similar to pthread_suspend_all_np(3). The pthread_multi_np() function switches the process to a multi-threaded mode. The semantics of this function is similar to pthread_resume_all_np(3). RETURN VALUES
The pthread_multi_np() and pthread_single_np functions always return 0. SEE ALSO
pthread_resume_all_np(3), pthread_suspend_all_np(3) AUTHORS
This manual page was written by Alexey Zelkin <phantom@FreeBSD.org>. BSD
February 13, 2003 BSD
All times are GMT -4. The time now is 04:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy