Re: Interpreting os.lstat()

2007-07-21 Thread Martin v. Löwis
> Absolutely, which is why I consider it foolish for the OP to be > trying to deduce the meaning of os.stat by looking at the output > of the stat program, rather than studying the man page for the > stat system call. Ah, ok. I missed that the OP had brought stat(1) into the discussion. Now it's a

Re: Interpreting os.lstat()

2007-07-21 Thread Sion Arrowsmith
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote: >> But it obviously does a lot of other stuff, including formatting >> the results of the system call for display. >It most decisively does *not* format the results of the system call >"for display". "It" here refers to the p

Re: Interpreting os.lstat()

2007-07-20 Thread Martin v. Löwis
> But it obviously does a lot of other stuff, including formatting > the results of the system call for display. It most decisively does *not* format the results of the system call "for display". Instead, it converts the C data type holding the stat result into a Python data type. That data type

Re: Interpreting os.lstat()

2007-07-20 Thread Sion Arrowsmith
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote: >> (a) Running 'stat' is *not the same* as a system call. >Why do you say that? It is *exactly* the same [ ... ] Maybe if stat were implemented as int main(int argc, char** argv) { struct stat so_what_am_I_supposed_to_do_

Re: Interpreting os.lstat()

2007-07-19 Thread Martin v. Löwis
> (a) Running 'stat' is *not the same* as a system call. Why do you say that? It is *exactly* the same, at least on a POSIX system (on Windows, there is no stat, so the implementation has to map that to several system calls). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Interpreting os.lstat()

2007-07-19 Thread Adrian Petrescu
On Jul 19, 4:27 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Adrian Petrescu <[EMAIL PROTECTED]> writes: > > I checked the online Python documentation > > athttp://python.org/doc/1.5.2/lib/module-stat.html > > but it just says to "consult the documentation for your system.". > > The page you're

Re: Interpreting os.lstat()

2007-07-19 Thread Sion Arrowsmith
Adrian Petrescu <[EMAIL PROTECTED]> wrote: print os.stat.__doc__ >stat(path) -> stat result > >Perform a stat system call on the given path. > >I checked the online Python documentation at >http://python.org/doc/1.5.2/lib/module-stat.html Someone else has already pointed out that this is ho

Re: Interpreting os.lstat()

2007-07-19 Thread Hrvoje Niksic
Adrian Petrescu <[EMAIL PROTECTED]> writes: > I checked the online Python documentation at > http://python.org/doc/1.5.2/lib/module-stat.html > but it just says to "consult the documentation for your system.". The page you're looking for is at http://www.python.org/doc/current/lib/os-file-dir.ht

Re: Interpreting os.lstat()

2007-07-18 Thread Will Maier
On Wed, Jul 18, 2007 at 05:55:59PM -0700, Adrian Petrescu wrote: > I can see some correspondence between the "stat" call and os.lstat > (for example, I'm guessing os.lstat(path)[6] represents the filesize), > but I can't see the correspondence between some of the other fields. > What does os.lstat(