473,508 Members | 2,330 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

understanding stat module names

I'm trying to use os.chmod and am refered to the stat module.

Is there are explanation of:
* S_ISUID
* S_ISGID
* S_ENFMT
* S_ISVTX
* S_IREAD
* S_IWRITE
* S_IEXEC
* S_IRWXU
* S_IRUSR
* S_IWUSR
* S_IXUSR
* S_IRWXG
* S_IRGRP
* S_IWGRP
* S_IXGRP
* S_IRWXO
* S_IROTH
* S_IWOTH
* S_IXOTH

this isn't much help:

dir(stat)
['ST_ATIME', 'ST_CTIME', 'ST_DEV', 'ST_GID', 'ST_INO', 'ST_MODE',
'ST_MTIME', 'ST_NLINK', 'ST_SIZE', 'ST_UID', 'S_ENFMT', 'S_IEXEC',
'S_IFBLK', 'S_IFCHR', 'S_IFDIR', 'S_IFIFO', 'S_IFLNK', 'S_IFMT', 'S_IFREG',
'S_IFSOCK', 'S_IMODE', 'S_IREAD', 'S_IRGRP', 'S_IROTH', 'S_IRUSR',
'S_IRWXG', 'S_IRWXO', 'S_IRWXU', 'S_ISBLK', 'S_ISCHR', 'S_ISDIR',
'S_ISFIFO', 'S_ISGID', 'S_ISLNK', 'S_ISREG', 'S_ISSOCK', 'S_ISUID',
'S_ISVTX', 'S_IWGRP', 'S_IWOTH', 'S_IWRITE', 'S_IWUSR', 'S_IXGRP',
'S_IXOTH', 'S_IXUSR', '__builtins__', '__doc__', '__file__', '__name__']
print stat.__doc__

Constants/functions for interpreting results of os.stat() and os.lstat().

Suggested usage: from stat import *


--
David Bear
-- let me buy your intellectual property, I want to own your thoughts --
Jan 18 '06 #1
3 3922
David Bear wrote:
I'm trying to use os.chmod and am refered to the stat module.

Is there are explanation of:
* S_ISUID
* S_ISGID
* S_ENFMT
* S_ISVTX
* S_IREAD
* S_IWRITE
* S_IEXEC
* S_IRWXU
* S_IRUSR
* S_IWUSR
* S_IXUSR
* S_IRWXG
* S_IRGRP
* S_IWGRP
* S_IXGRP
* S_IRWXO
* S_IROTH
* S_IWOTH
* S_IXOTH

this isn't much help:

dir(stat)
['ST_ATIME', 'ST_CTIME', 'ST_DEV', 'ST_GID', 'ST_INO', 'ST_MODE',
'ST_MTIME', 'ST_NLINK', 'ST_SIZE', 'ST_UID', 'S_ENFMT', 'S_IEXEC',
'S_IFBLK', 'S_IFCHR', 'S_IFDIR', 'S_IFIFO', 'S_IFLNK', 'S_IFMT', 'S_IFREG',
'S_IFSOCK', 'S_IMODE', 'S_IREAD', 'S_IRGRP', 'S_IROTH', 'S_IRUSR',
'S_IRWXG', 'S_IRWXO', 'S_IRWXU', 'S_ISBLK', 'S_ISCHR', 'S_ISDIR',
'S_ISFIFO', 'S_ISGID', 'S_ISLNK', 'S_ISREG', 'S_ISSOCK', 'S_ISUID',
'S_ISVTX', 'S_IWGRP', 'S_IWOTH', 'S_IWRITE', 'S_IWUSR', 'S_IXGRP',
'S_IXOTH', 'S_IXUSR', '__builtins__', '__doc__', '__file__', '__name__']
print stat.__doc__


Constants/functions for interpreting results of os.stat() and os.lstat().

Suggested usage: from stat import *

from stat.h of Microsoft Visual C++ .NET 2003:

#define _S_IFMT 0170000 /* file type mask */
#define _S_IFDIR 0040000 /* directory */
#define _S_IFCHR 0020000 /* character special */
#define _S_IFIFO 0010000 /* pipe */
#define _S_IFREG 0100000 /* regular */
#define _S_IREAD 0000400 /* read permission, owner */
#define _S_IWRITE 0000200 /* write permission, owner */
#define _S_IEXEC 0000100 /* execute/search permission,
owner */
#define S_IFMT _S_IFMT
#define S_IFDIR _S_IFDIR
#define S_IFCHR _S_IFCHR
#define S_IFREG _S_IFREG
#define S_IREAD _S_IREAD
#define S_IWRITE _S_IWRITE
#define S_IEXEC _S_IEXEC

struct stat {
_dev_t st_dev;
_ino_t st_ino;
unsigned short st_mode;
short st_nlink;
short st_uid;
short st_gid;
_dev_t st_rdev;
_off_t st_size;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
};

From MSDN Help:

The _fstat function obtains information about the open file associated
with fd and stores it in the structure pointed to by buffer. The _stat
structure, defined in SYS\STAT.H, contains the following fields:

st_atime
Time of last file access.
st_ctime
Time of creation of file.
st_dev
If a device, fd; otherwise 0.
st_mode
Bit mask for file-mode information. The _S_IFCHR bit is set if fd refers
to a device. The _S_IFREG bit is set if fd refers to an ordinary file.
The read/write bits are set according to the file's permission mode.
_S_IFCHR and other constants are defined in SYS\STAT.H.
st_mtime
Time of last modification of file.
st_nlink
Always 1 on non-NTFS file systems.
st_rdev
If a device, fd; otherwise 0.
st_size
Size of the file in bytes.

Probably googling for the constants will show up some more useful
information , too.

Hope this helps.

Claudio
Jan 19 '06 #2
David Bear wrote:
I'm trying to use os.chmod and am refered to the stat module.

Is there are explanation of:
* S_ISUID .... * S_IXOTH


These come from the POSIX standard. See
http://www.opengroup.org/onlinepubs/...sysstat.h.html

HTH,
Marius Gedminas

Jan 19 '06 #3
Claudio Grondi wrote:
David Bear wrote:
I'm trying to use os.chmod and am refered to the stat module.

Is there are explanation of:
* S_ISUID
* S_ISGID
* S_ENFMT
* S_ISVTX
* S_IREAD
* S_IWRITE
* S_IEXEC
* S_IRWXU
* S_IRUSR
* S_IWUSR
* S_IXUSR
* S_IRWXG
* S_IRGRP
* S_IWGRP
* S_IXGRP
* S_IRWXO
* S_IROTH
* S_IWOTH
* S_IXOTH

this isn't much help:

dir(stat)
['ST_ATIME', 'ST_CTIME', 'ST_DEV', 'ST_GID', 'ST_INO', 'ST_MODE',
'ST_MTIME', 'ST_NLINK', 'ST_SIZE', 'ST_UID', 'S_ENFMT', 'S_IEXEC',
'S_IFBLK', 'S_IFCHR', 'S_IFDIR', 'S_IFIFO', 'S_IFLNK', 'S_IFMT',
'S_IFREG', 'S_IFSOCK', 'S_IMODE', 'S_IREAD', 'S_IRGRP', 'S_IROTH',
'S_IRUSR', 'S_IRWXG', 'S_IRWXO', 'S_IRWXU', 'S_ISBLK', 'S_ISCHR',
'S_ISDIR', 'S_ISFIFO', 'S_ISGID', 'S_ISLNK', 'S_ISREG', 'S_ISSOCK',
'S_ISUID', 'S_ISVTX', 'S_IWGRP', 'S_IWOTH', 'S_IWRITE', 'S_IWUSR',
'S_IXGRP', 'S_IXOTH', 'S_IXUSR', '__builtins__', '__doc__', '__file__',
'__name__']
>print stat.__doc__


Constants/functions for interpreting results of os.stat() and os.lstat().

Suggested usage: from stat import *

from stat.h of Microsoft Visual C++ .NET 2003:

#define _S_IFMT 0170000 /* file type mask */
#define _S_IFDIR 0040000 /* directory */
#define _S_IFCHR 0020000 /* character special */
#define _S_IFIFO 0010000 /* pipe */
#define _S_IFREG 0100000 /* regular */
#define _S_IREAD 0000400 /* read permission, owner */
#define _S_IWRITE 0000200 /* write permission, owner */
#define _S_IEXEC 0000100 /* execute/search permission,
owner */
#define S_IFMT _S_IFMT
#define S_IFDIR _S_IFDIR
#define S_IFCHR _S_IFCHR
#define S_IFREG _S_IFREG
#define S_IREAD _S_IREAD
#define S_IWRITE _S_IWRITE
#define S_IEXEC _S_IEXEC

struct stat {
_dev_t st_dev;
_ino_t st_ino;
unsigned short st_mode;
short st_nlink;
short st_uid;
short st_gid;
_dev_t st_rdev;
_off_t st_size;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
};

From MSDN Help:

The _fstat function obtains information about the open file associated
with fd and stores it in the structure pointed to by buffer. The _stat
structure, defined in SYS\STAT.H, contains the following fields:

st_atime
Time of last file access.
st_ctime
Time of creation of file.
st_dev
If a device, fd; otherwise 0.
st_mode
Bit mask for file-mode information. The _S_IFCHR bit is set if fd refers
to a device. The _S_IFREG bit is set if fd refers to an ordinary file.
The read/write bits are set according to the file's permission mode.
_S_IFCHR and other constants are defined in SYS\STAT.H.
st_mtime
Time of last modification of file.
st_nlink
Always 1 on non-NTFS file systems.
st_rdev
If a device, fd; otherwise 0.
st_size
Size of the file in bytes.

Probably googling for the constants will show up some more useful
information , too.

Hope this helps.

Claudio


Thnks for the info. I didn't even think I would have to look in a unix/c ref
manual. This was usefull.

http://www.opengroup.org/onlinepubs/...sysstat.h.html

--
David Bear
-- let me buy your intellectual property, I want to own your thoughts --
Jan 19 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1675
by: Gian Mario Tagliaretti | last post by:
Hi guys, maybe is an easy question but there is something I haven't understood I will post the example for better explain Python 2.3.4c1 (#2, May 13 2004, 21:46:36) >>> import os >>>...
0
1203
by: Bob Palank | last post by:
In creating content for a VC++.NET programming class, I'd like the students to create a single form application starting with an Empty Project(.NET) and then construct the application step by step...
0
1198
by: davidlmontgomery | last post by:
I'm trying to use both nosetests and doctest with the tests pulled out into a separate file. My problem is that it seems that I need to use different import statements depending on from where I...
9
2331
by: Rudy | last post by:
Hello All! I'm a little confused on Public Class or Modules. Say I have a this on form "A" Public Sub Subtract() Dim Invoice As Decimal Dim Wage As Decimal Static PO As Decimal Invoice =...
24
6057
by: Joe Salmeri | last post by:
I just upgraded from Python 2.4.2 to Python 2.5.1 and have found some unexpected behavior that appears to be a bug in the os.stat module. My OS is Windows XP SP2 + all updates. I have several...
0
7342
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.