[issue40095] Incorrect st_ino returned for ReFS on Windows 10

2020-03-28 Thread Martynas Brijunas


Martynas Brijunas  added the comment:

Hi Steve, Eryk,

thank you very much for looking into this. I was looking into "st_ino"
as a potential substitute of a full path of a file when it comes to
uniquely identifying that file in a database.

> ReFS uses a 128-bit file ID, which I gather consists of a 64-bit directory ID 
> and a 64-bit relative ID. (Take this with a grain of salt. AFAIK, Microsoft 
> hasn't published a spec for ReFS.) The latter is 0 for the directory itself 
> and increments by 1 for each file created in the directory, with no reuse of 
> previous values if a file is deleted or moved. If that's correct, and if 
> "test.jpg" was created in "\test", then the directory ID of "\test" is 
> 0x29d5, and the relative file ID is 0x4ae.

This assumption seems to be correct. All files within the same
directory have identical first half of their ID, as reported by
"fsutil".

U:\test>fsutil file queryfileid test.jpg
File ID is 0x29d504ae

U:\test>fsutil file queryfileid test.nef
File ID is 0x29d50483

U:\test>fsutil file queryfileid test.ARW
File ID is 0x29d50484

U:\test>fsutil file queryfileid test.db
File ID is 0x29d50495

>
> > >>> from pathlib import Path
> > >>> hex(Path('U:/test/test.jpg').stat().st_ino)
> > '0x44ae29d5'
>
> os.stat calls WINAPI GetFileInformationByHandle, which returns a 64-bit file 
> ID. It appears that ReFS generates this ID by concatenating the relative ID 
> and directory ID in a way that is "not guaranteed to be unique" according to 
> the BY_HANDLE_FILE_INFORMATION [1] docs.

The feedack from "st_ino" appears to be in total sync with "fsutil".
The only real difference (apart for the for the missing leading zeros
in each half) is the inclusion of a hex "4" at the very beginning of
the hex sequence. But even that is consistent as the "4" is present in
all cases.

>>> hex(Path('U:/test/test.jpg').stat().st_ino)
'0x44ae29d5'
>>> hex(Path('U:/test/test.nef').stat().st_ino)
'0x448329d5'
>>> hex(Path('U:/test/test.arw').stat().st_ino)
'0x448429d5'
>>> hex(Path('U:/test/test.db').stat().st_ino)
'0x449529d5'

--

___
Python tracker 
<https://bugs.python.org/issue40095>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40095] Incorrect st_ino returned for ReFS on Windows 10

2020-03-28 Thread Martynas Brijunas


New submission from Martynas Brijunas :

On a Windows 10 volume formatted with ReFS, pathlib.Path.stat() returns an 
incorrect value for "st_ino".

The correct value returned by the OS:

C:\Users>fsutil file queryfileid u:\test\test.jpg
File ID is 0x29d504ae

An incorrect value obtained with pathlib.Path.stat():

Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from pathlib import Path
>>> hex(Path('U:/test/test.jpg').stat().st_ino)
'0x44ae29d5'

The problem does *not* exist on an NTFS volume:

C:\Users>fsutil file queryfileid o:\OneDrive\test\test.jpg
File ID is 0x00030001be39

>>> hex(Path('O:/OneDrive/test/test.jpg').stat().st_ino)
'0x30001be39'

--
components: Library (Lib)
messages: 365206
nosy: mbri...@gmail.com
priority: normal
severity: normal
status: open
title: Incorrect st_ino returned for ReFS on Windows 10
type: behavior
versions: Python 3.8

___
Python tracker 
<https://bugs.python.org/issue40095>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23413] Incorrect division result

2015-02-08 Thread Martynas Brijunas

New submission from Martynas Brijunas:

Dear Python team,

when dividing 3 by 7, I expect to get the following result:

0.428571428571428571428571428571428571428571428571428571428571...

What I am getting in the Python interpreter is this:

 3 / 7
0.42857142857142855

Which in my opinion is incorrect.

--
messages: 235564
nosy: Martynas.Brijunas
priority: normal
severity: normal
status: open
title: Incorrect division result
type: behavior
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23413
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com