Sponsored Content
Full Discussion: Open function of sys/stat.h
Top Forums Programming Open function of sys/stat.h Post 302412004 by cyler on Saturday 10th of April 2010 04:57:33 PM
Old 04-10-2010
Quote:
Originally Posted by jim mcnamara
Is this what you are asking?
Yes, thank you, it is good to know that you can get file attributes even if the file is locked. I was not aware of access().
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

function to test if file is open

I need to write a function that will work in sh/ksh shell that will test to see if a file has already been opened for writting by another user has anyone written something like this? (3 Replies)
Discussion started by: johnsonbryce
3 Replies

2. Programming

Hi errno in sys/stat.h

How should I use errno in a c program and what info does it have . I am working with directories and files. So can any one tell me How to access errno?I am using the stat() function on \etc directory and I am alble to access only the half of the directories.I am not able to access other half and... (6 Replies)
Discussion started by: vijlak
6 Replies

3. Programming

Q with stat()

From reading various articles on the net, I know stat() is used on files to get things like permissions, sizes etc... As a folder is a special type of file in Unix, I assumed that stat() could work on it as well as any general file. However, from running my program, perror() reported that the... (3 Replies)
Discussion started by: JamesGoh
3 Replies

4. UNIX and Linux Applications

Sybase help: Open client, bcp function

To begin: I use Linux The Problem: I need bcp functionality for scripts. Perl modules, such as Sybase:xfer, require ctlib which comes with Sybase Open Client. Talking with Sybase sales reps is an exercise in futility and hate. They know absolutely nothing about their own products and will... (0 Replies)
Discussion started by: Bubnoff
0 Replies

5. Programming

could not open source file "sys/elf_386.h"

Hello All, i am porting my application from SunSolaris to Linux (RHEL4). When i compile my c/c++ code i am getting the following errors. 1. catastrophic error: could not open source file "sys/elf_386.h" #include <sys/elf_386.h> 2. catastrophic error: could not open source file... (2 Replies)
Discussion started by: tsaravanan
2 Replies

6. Shell Programming and Scripting

Help !! perl open function

Help Please perl Gurus, I am trying to add ungrouped passengers in a group and I creating a script however it fails on first step only I tried all the options it returns following error. syntax error at junki line 4, near "open " Execution of junki aborted due to compilation errors. ... (2 Replies)
Discussion started by: dynamax
2 Replies

7. Shell Programming and Scripting

Stat value changes

Die to what all operations, the "Modify" and "Change" values of stat output changes for a file. I found, during editing a file, Change and Modify alters. When chmod'ing Change alters, while Modify doesnot alters. Is there more situations where these changes? (1 Reply)
Discussion started by: anil510
1 Replies

8. Programming

Function open() sets errno

I am opening a text file using open() system call in O_RDONLY mode. open() returns me a valid handler but also sets errno to 13 i.e. EACCES(Permission denied). Question is when open() is returning a valid handler then why does it sets the errno? Should not errno be set only in case of error... (10 Replies)
Discussion started by: rupeshkp728
10 Replies

9. Shell Programming and Scripting

Open file function

Hello all, just a quick little part of code i'm writing to check if the file i'm writing too in my automatic process is not being written too manually. #!/bin/bash FUSER=$(/sbin/fuser -s /toto.tmp >/dev/null 2>&1) LSOF=$(/usr/sbin/lsof | grep -q "toto.tmp") PGREP=$(pgrep -f "toto.tmp" >... (6 Replies)
Discussion started by: maverick72
6 Replies

10. Programming

Interactive Python 3.5+ sys.stdout.write() AND sys.stderr.write() bug?

(Apologies for any typos.) OSX 10.12.3 AND Windows 10. This is for the serious Python experts on at least 3.5.x and above... In script format sys.stdout.write() AND sys.stderr.write() seems to work correctly. Have I found a serious bug in the interactive sys.stdout.write() AND... (2 Replies)
Discussion started by: wisecracker
2 Replies
AUTHOPEN(1)						    BSD General Commands Manual 					       AUTHOPEN(1)

NAME
authopen -- open file with authorization SYNOPSIS
authopen [-stdoutpipe] [-extauth] filename authopen [-stdoutpipe] [-extauth] -w [-a] filename authopen [-stdoutpipe] [-extauth] -c [-x -m mode -w] filename authopen [-stdoutpipe] [-extauth] -o flags filename authopen -h DESCRIPTION
authopen provides authorization-based file opening services. In its simplest form, authopen verifies that it is allowed to open filename (using an appropriate sys.openfile.* authorization right) and then writes the file to stdout. If -w is specified, authopen will read from stdin and write to the file. authopen is designed to be used both from the command line and programmatically. The -stdoutpipe flag allows a parent process to receive an open file descriptor pointing to the file in question. Before opening filename, authopen will make an authorization request for a right of the form: sys.openfile.[readonly|readwrite|readwritecreate]./fully/qualified/path '.readonly' rights only allow for read-only file descriptors. '.readwrite' rights allow for read/write file descriptors. '.readwritecreate' rights allow for read/write descriptors and the creation of new files. The -extauth option can be used to provide an AuthorizationRef constructed by the client. This generally prevents authopen from presenting an authorization dialog containing its own name. OPTIONS
-stdoutpipe specifies that STDOUT_FILENO has been dup2()'d onto a pipe to a parent process and that an open file descriptor to filename (with the appropriate access mode) should be sent back across it using the SCM_RIGHTS extension to sendmsg(2) rather than having the file itself written to or read from stdin / stdout. -extauth specifies that authopen should read one AuthorizationExternalForm structure from stdin, convert it to an AuthorizationRef, and attempt to use it to authorize the open(2) operation. The authorization should refer to the sys.apenfile right corresponding to the requested operation. The authorization data will be read before any additional data supplied on stdin, and will not be included in data written with -w. -w instructs authopen to open filename read/write and truncate it. If -stdoutpipe has not been specified, authopen will then copy stdin to filename until stdin is closed. -a append to filename rather than truncating it (truncating is the default). -c create the file if it doesn't exist. -m requires -c. -m mode specify the mode bits if a file is created. -o flags numerically specify the flags that should be passed to open(2). -x require that the file being created not exist. EXAMPLES
To replace /etc/hostconfig (assuming sys.openfile.readwrite./etc/hostconfig or better can be obtained): $ cat tmpdata | authopen -w /etc/hostconfig ERRORS
authopen will fail if an appropriate sys.openfile.readonly.*, sys.openfile.readwrite.*, or sys.openfile.readwritecreate.* right cannot be obtained or if the named path does not exist. BUGS
authopen should support prefix path authentication such that the right sys.openfile.*./dev/ could give access to all /dev entries and sys.openfile.*./dev/disk1 could give access to all disk1-related /dev entries. authopen should use getopt(3). LOCATION
/usr/libexec/authopen SEE ALSO
open(2), Security/Authorization.h, realpath(3), recvmsg(2). W. Richard Stevens, "Passing File Descriptors", Advanced Programming in the UNIX Environment. HISTORY
authopen appeared in Mac OS X 10.1 to assist with the manipulation of disk devices. Darwin 28 Feb 2013 Darwin
All times are GMT -4. The time now is 12:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy