Sponsored Content
Top Forums Programming How can I make ls -l in HP-UNIX? Post 7285 by shaik786 on Monday 24th of September 2001 05:39:56 AM
Old 09-24-2001
check the /usr/include/sys/stat.h for the structure definition of 'stat':

struct stat
{
.
.

mode_t st_mode; /* File mode; see #define's in */
uid_t st_uid; /* User ID of the file's owner */
gid_t st_gid; /* Group ID of the file's group */

.
.
};

1.) where st_mode will give u the Access (/usr/include/sys/mode.h has all the access modes)
2.) st_uid will give u the user id which can b mapped with: /etc/passwd for the UID
3.) st_gid will give u the group id which can b mapped with: /etc/passwd for the GID

all the rest of the information is present in the structure 'stat' (/usr/include/sys/stat.h)

Regards
SHAIK
shaik786
 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Make file in Unix

How to make files in Unix (6 Replies)
Discussion started by: gandhevinod
6 Replies

2. Shell Programming and Scripting

how to make VI editor show colors in Unix

Hi, I saw some people's vi editor show different colors on the text according the nature of text when using it. It would be nice if I can see diffrerent colors with my vi editor. Do anybody know how to set it up? I use PowerTermPro program to access unix machine. I tried to use vim editor but... (7 Replies)
Discussion started by: whatisthis
7 Replies

3. UNIX for Dummies Questions & Answers

Make a copy of a unix HDD

i have this HDD with SCO 5.0.6 and i'm getting this errors WARNING: wd0: Error on fixed disk dev 1/42, block=4829, cmd=0x000000C8 Sun Mar 11 05:50:08 2007 status=0x00000040, LBA sector=1285723, cylinder/head=5022/0 WARNING: wd0: Error... (0 Replies)
Discussion started by: josramon
0 Replies

4. Programming

Unix Make

I need tutorial on Make utility on Unix. Any help or link appreciated. many thanks Mirko (3 Replies)
Discussion started by: mmipko
3 Replies

5. UNIX for Dummies Questions & Answers

How to make sound using C under UNIX

i'm programming using C under UNIX. i wonder to how make sound using C ? any sound like "beep" would be fine. thx. :confused: (6 Replies)
Discussion started by: trapeze
6 Replies

6. Solaris

how to make file link in c under unix

how to make link command by c language (2 Replies)
Discussion started by: ma7moudax
2 Replies

7. Hardware

How to make terminals with a PC(UNIX/LInux) support?

I want to build a network, in this network there is only one PC and 50 terminals, 50 students can use this system to study UNIX/Linux. In the old days, computer was very expensive, many scientists shared a computer with terminals, that means a terminal has no cpu, memory and hardisk. In... (5 Replies)
Discussion started by: haixiao_liu
5 Replies

8. HP-UX

HP-unix make file Problem

Dear Unixians, I have try to link my libraries with tuxedo that showing following errors, ] My make file few lines: .... actual linking regards, kkl (1 Reply)
Discussion started by: kkl
1 Replies

9. Shell Programming and Scripting

How can i make a report from some insert in UNIX shell?

I have some insert in my unix shell script. This every insert has a spool (a file with datas) and a sql file with the query. I have to create a report file with three columns: The first(TAB_NAME) will contains the name of the table in wich has been done the insert, the second (STATE) will... (7 Replies)
Discussion started by: punticci
7 Replies

10. Shell Programming and Scripting

Make bold chars in UNIX

Hi all, I want to make the string as bold in unix. is there any way to acheive this? thanks in advance. (16 Replies)
Discussion started by: SekhaReddy
16 Replies
FSTAT(3P)						     POSIX Programmer's Manual							 FSTAT(3P)

PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond- ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME
fstat - get file status SYNOPSIS
#include <sys/stat.h> int fstat(int fildes, struct stat *buf); DESCRIPTION
The fstat() function shall obtain information about an open file associated with the file descriptor fildes, and shall write it to the area pointed to by buf. If fildes references a shared memory object, the implementation shall update in the stat structure pointed to by the buf argument only the st_uid, st_gid, st_size, and st_mode fields, and only the S_IRUSR, S_IWUSR, S_IRGRP, S_IWGRP, S_IROTH, and S_IWOTH file permission bits need be valid. The implementation may update other fields and flags. If fildes references a typed memory object, the implementation shall update in the stat structure pointed to by the buf argument only the st_uid, st_gid, st_size, and st_mode fields, and only the S_IRUSR, S_IWUSR, S_IRGRP, S_IWGRP, S_IROTH, and S_IWOTH file permission bits need be valid. The implementation may update other fields and flags. The buf argument is a pointer to a stat structure, as defined in <sys/stat.h>, into which information is placed concerning the file. The structure members st_mode, st_ino, st_dev, st_uid, st_gid, st_atime, st_ctime, and st_mtime shall have meaningful values for all other file types defined in this volume of IEEE Std 1003.1-2001. The value of the member st_nlink shall be set to the number of links to the file. An implementation that provides additional or alternative file access control mechanisms may, under implementation-defined conditions, cause fstat() to fail. The fstat() function shall update any time-related fields as described in the Base Definitions volume of IEEE Std 1003.1-2001, Section 4.7, File Times Update, before writing into the stat structure. RETURN VALUE
Upon successful completion, 0 shall be returned. Otherwise, -1 shall be returned and errno set to indicate the error. ERRORS
The fstat() function shall fail if: EBADF The fildes argument is not a valid file descriptor. EIO An I/O error occurred while reading from the file system. EOVERFLOW The file size in bytes or the number of blocks allocated to the file or the file serial number cannot be represented correctly in the structure pointed to by buf. The fstat() function may fail if: EOVERFLOW One of the values is too large to store into the structure pointed to by the buf argument. The following sections are informative. EXAMPLES
Obtaining File Status Information The following example shows how to obtain file status information for a file named /home/cnd/mod1. The structure variable buffer is defined for the stat structure. The /home/cnd/mod1 file is opened with read/write privileges and is passed to the open file descriptor fildes. #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> struct stat buffer; int status; ... fildes = open("/home/cnd/mod1", O_RDWR); status = fstat(fildes, &buffer); APPLICATION USAGE
None. RATIONALE
None. FUTURE DIRECTIONS
None. SEE ALSO
lstat(), stat(), the Base Definitions volume of IEEE Std 1003.1-2001, <sys/stat.h>, <sys/types.h> COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . IEEE
/The Open Group 2003 FSTAT(3P)
All times are GMT -4. The time now is 04:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy