Sponsored Content
Top Forums Programming Determining file access perms for current process Post 302467671 by DGPickett on Saturday 30th of October 2010 05:43:31 PM
Old 10-30-2010
I find it is less code and especially less testing to do the once-daily or once-hourly housekeeping tasks in shell, especially when shell has many handy tools for that, and do just the need-for-speed bits in very simple C. I am not much into system calls, popen() occasionally so as not to have to rewrite thing and so as to get multiprocessing. I did find this was a nice system call, if you want a sort, like in COBOL (-:
Code:
system 'mknod /tmp/xxx p ; sort . . . -o /tmp/xxx /tmp/xxx &'
Open, Write data to, close /tmp/xxx
open, read result from, close /tmp/xxx
unlink() /tmp/xxx

So, was access() what you needed?
 

10 More Discussions You Might Find Interesting

1. Programming

to find current running process

Hi All, The scenario is like this: There is a process say "A" which create a child process say "B" if some condition is true and process "A" terminates. "B" invokes some C program say "C" using 'execl' function. The job of program "C" is to keep polling the server until the server will be up.... (2 Replies)
Discussion started by: ranjkuma692
2 Replies

2. Shell Programming and Scripting

current running process in shell

hi what is the shell programming code to know the number of processes currently running on the machine & information about those processes. Another one is the configuration and usage of the UNIX file system? requesting all for help. thanks (1 Reply)
Discussion started by: moco
1 Replies

3. Shell Programming and Scripting

Displaying current user process

When I typed in ps -a I get this: PID TTY TIME CMD 31799 pts/3 00:00:00 vim 31866 pts/3 00:00:00 vim And to check who is currently logged in, I type who Felix Whoals Tada Whoals Lala Whoals How can I get the user process for all current users who logged in?? I think I need to combine... (14 Replies)
Discussion started by: felixwhoals
14 Replies

4. UNIX for Dummies Questions & Answers

Current Process Running.

Hi all, When I issued command ps -ef|grep Vinay in a UNIX machine, I got the following Vinay 22491 1 255 Jun 18 ? 294248:53 -sh Vinay 26628 1 255 Jun 18 ? 294237:33 -sh Could you tell me what all process is running ? Please explain each of the fields. Thanks... (4 Replies)
Discussion started by: coolbhai
4 Replies

5. Solaris

shell-init: could not get current directory: getcwd: cannot access parent directories

Hello root@ne-ocadev-1:/root/scripts>su espos -c find /a35vol100/ESPOS/oracle/db/9.2.0/oradata/ESPOS/archive -type f -atime +10 -exec ls {} shell-init: could not get current directory: getcwd: cannot access parent directories: Permission denied find: insufficient number of... (6 Replies)
Discussion started by: babu.knb
6 Replies

6. Solaris

file open/read/write/close/access by process

Hi want to know what file (descriptor+filename+socket) is being accessed by particular process on solaris. Purpose : while running perf. test, needs to find where is the bottleneck. We are providing concurrnet load for around 1 hr and needs to capture data related to file usage pattern... (1 Reply)
Discussion started by: raxitsheth
1 Replies

7. UNIX for Advanced & Expert Users

Determining interface to access IP

Hello I've got a server with multiple NICS. In a script I want to log the outbound interface. Is there an easy way I can do this so that the output looks something like this: host(xxx.xxx.xxx.xxx): Opening connection to ... Obviously, getting the host is simple with hostname. But how... (4 Replies)
Discussion started by: brsett
4 Replies

8. UNIX for Dummies Questions & Answers

Running different process from current process?

I have been having some trouble trying to get some code working, so I was wondering...what system calls are required to execute a different program from an already running process? (1 Reply)
Discussion started by: Midwest Product
1 Replies

9. UNIX for Dummies Questions & Answers

Determining if a process is active in UNIX

We have written a bare bones scheduling app using bash scripts. The input to the scheduler is from a mainframe scheduling tool, and the scripts exit code is returned to the MF. The problem is that every now and again I have a script that does not complete and this is left in my Q. I am in the... (1 Reply)
Discussion started by: Charles Swart
1 Replies

10. UNIX for Dummies Questions & Answers

Unable to access current user's mailbox.

In any non-root account, whenever I enter mail, it gives me: /var/spool/mail/root: Permission deniedI am not logged in as root, why is mail accessing root's mailbox ? I am unable to enter the currently logged in user's mailbox. Any help is appreciated :) (2 Replies)
Discussion started by: Hijanoqu
2 Replies
pathfind(3G)															      pathfind(3G)

NAME
pathfind() - search for named file in named directories SYNOPSIS
DESCRIPTION
searches the directories named in path for the file name. The directories named in path are separated by colons. mode is a string of option letters chosen from the set Letter Meaning --------------------------- r readable w writable x executable f normal file b block special c character special d directory p FIFO (pipe) u set user ID bit g set group ID bit k sticky bit s size nonzero Options read, write, and execute are checked relative to the real (not the effective) user ID and group ID of the current process. If the file name, with all the characteristics specified by mode, is found in any of the directories specified by path, then returns a pointer to a string containing the member of path, followed by a slash character followed by name. If name begins with a slash, it is treated as an absolute path name, and path is ignored. An empty path member is treated as the current directory. is not prepended at the occurrence of the first match; rather, the unadorned name is returned. To use this interface, link in the libgen library by specifying For example: RETURN VALUE
If no match is found, returns a null pointer, EXAMPLES
To find the command using the environment variable: WARNINGS
The string pointed to by the returned pointer is stored in a static area that is reused on subsequent calls to SEE ALSO
sh(1), test(1), access(2), mknod(2), stat(2), getenv(3C), thread_safety(5). pathfind(3G)
All times are GMT -4. The time now is 04:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy