Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > os.stat('<filename>')[stat.ST_INO] on Windows

Reply
Thread Tools

os.stat('<filename>')[stat.ST_INO] on Windows

 
 
Patrick Useldinger
Guest
Posts: n/a
 
      02-27-2005
What does the above yield on Windows? Are inodes supported on Windows
NTFS, FAT, FAT32?
 
Reply With Quote
 
 
 
 
jepler@unpythonic.net
Guest
Posts: n/a
 
      02-27-2005

On Sun, Feb 27, 2005 at 10:16:34PM +0100, Patrick Useldinger wrote:
> What does the above yield on Windows? Are inodes supported on Windows
> NTFS, FAT, FAT32?


Refer to the operating system documentation (msdn.microsoft.com?). os.stat is
mostly a wrapper around whatever the OS provides. A quick glance at Python
source code shows that maybe _stati64() or _wistat64() is the actual function
used on windows.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFCIkDoJd01MZaTXX0RAgACAJ9+H7OKtjIrJdyK/UArnK4OoEEY7QCcD7WO
WuKIgnPXIvbd+Hx5iNZ2/L8=
=Fj/b
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
Guest
Posts: n/a
 
      02-27-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Refer to the operating system documentation (msdn.microsoft.com?).

os.stat is
> mostly a wrapper around whatever the OS provides. A quick glance at Python
> source code shows that maybe _stati64() or _wistat64() is the actual function
> used on windows.


That doesn't really help: MSDN says

"""Number of the information node (the inode) for the file
(UNIX-specific). On UNIX file systems, the inode describes the file date
and time stamps, permissions, and content. When files are hard-linked to
one another, they share the same inode. The inode, and therefore st_ino,
has no meaning in the FAT, HPFS, or NTFS file systems.
"""

So we know it has no meaning, but they won't tell us what its value is.
Fortunately, MS ships the source of the CRT in VC, so we know st_ino
is always 0 (as are st_uid and st_gid).

Regards,
Martin

 
Reply With Quote
 
Tim Roberts
Guest
Posts: n/a
 
      03-01-2005
Patrick Useldinger <(E-Mail Removed)> wrote:
>
>What does the above yield on Windows?


0.

>Are inodes supported on Windows NTFS, FAT, FAT32?


No. Inodes are strictly a Unix filesystem concept.
--
- Tim Roberts, (E-Mail Removed)
Providenza & Boekelheide, Inc.
 
Reply With Quote
 
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
Guest
Posts: n/a
 
      03-01-2005
Tim Roberts wrote:
>>Are inodes supported on Windows NTFS, FAT, FAT32?

>
>
> No. Inodes are strictly a Unix filesystem concept.


I disagree. NTFS MFT records are so similar to inodes
that their numbers could well be used in st_ino (except
that they are 64-bit quantities, whereas st_ino
typically has only 32 bits).

Regards,
Martin
 
Reply With Quote
 
Tim Roberts
Guest
Posts: n/a
 
      03-03-2005
"Martin v. L÷wis" <(E-Mail Removed)> wrote:
>
>Tim Roberts wrote:
>>>Are inodes supported on Windows NTFS, FAT, FAT32?

>>
>> No. Inodes are strictly a Unix filesystem concept.

>
>I disagree. NTFS MFT records are so similar to inodes
>that their numbers could well be used in st_ino (except
>that they are 64-bit quantities, whereas st_ino
>typically has only 32 bits).


Hmmm, yes, but nearly 100% of Unix geeks have seen an inode number in their
programming adventures, whereas I'll bet not 1 in 10,000 Windows hardliners
has ever seen an MFT entry.

There are things you can do with an inode number, but there's nothing you
can do with an MFT ordinal.

So, I'll grant that my answer was too specific, but I still believe the
answer to the original question is "no".
--
- Tim Roberts, (E-Mail Removed)
Providenza & Boekelheide, Inc.
 
Reply With Quote
 
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
Guest
Posts: n/a
 
      03-03-2005
Tim Roberts wrote:
> Hmmm, yes, but nearly 100% of Unix geeks have seen an inode number in their
> programming adventures, whereas I'll bet not 1 in 10,000 Windows hardliners
> has ever seen an MFT entry.


That is going to change. At my university, students learn what an MFT
record is and how it is structured as part of the operating system
course, just as they learn what an inode is.

I'll grant you that a MFT records are less visible, primarily because
people don't do hard links all that often. That might be changing as
well.

> There are things you can do with an inode number, but there's nothing you
> can do with an MFT ordinal.


Like what? On NTFS and Win32, you can even convert an inode number
efficiently back to a path name (actually, all path names), something
you cannot do on a typical Unix system (atleast not efficiently).

> So, I'll grant that my answer was too specific, but I still believe the
> answer to the original question is "no".


Yes, but that's the stupidity of the MS C library, which doesn't use
the nFileIndexHigh/nFileIndexLow fields of the
BY_HANDLE_FILE_INFORMATION structure (it also is the stupidity of the
Win32 API, which claims that you need an open file to support the
notion of a file identifier).

Regards,
Martin
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
!Windows Live Mail replace Outlook Express on Windows XP and Windows Mail on Vista... Max Burke NZ Computing 8 05-18-2007 12:10 AM
Windows XP Home Connected to Windows XP Pro via TCP/IP Armstrong Wong Wireless Networking 1 11-25-2004 01:12 PM
wireless ad-hoc with Windows XP and Windows 2000 =?Utf-8?B?ZHVtbWthdWY=?= Wireless Networking 1 09-23-2004 11:34 AM
Windows XP laptop and Windows 2000 desktop won't communicate =?Utf-8?B?UmlmbGVtYW4=?= Wireless Networking 0 08-19-2004 03:35 AM



Advertisments