Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not a valid Win32 FileTime. (Parameter 'fileTime') #280

Open
Muesli84 opened this issue Nov 30, 2024 · 3 comments
Open

Not a valid Win32 FileTime. (Parameter 'fileTime') #280

Muesli84 opened this issue Nov 30, 2024 · 3 comments

Comments

@Muesli84
Copy link

Hallo,

ich habe eine Samba-Freigabe auf Raspbian und greife von einem Windows-PC darauf zu.

Beim Auflisten der Inhalte mancher Verzeichnisse erhalte ich den Ausnahmefehler "Not a valid Win32 FileTime. (Parameter 'fileTime')".

Das liegt anscheinend daran, dass bei manchen Dateien kein "LastAccessTime" angegeben ist.
Der LittleEndianConverter liefert aus dem buffer für die FileDirectoryInformation den Wert 9223372036854775807 und dieser ist dann keine gültige UtcFileTime.
Das Ganze verhindert dann den Zugriff auf alle Dateien des Verzeichnisses.

Ich habe mir jetzt eine Kopie des Repository gezogen und die Fehler mit Rückgabe eines MinValue ignoriert, aber es wäre natürlich schön, wenn auch das offizielle NuGet-Paket diese Toleranz böte.

Gruß,
Martin

@Muesli84
Copy link
Author

Sorry!
I don't know why I came up with the idee to write in german here. ;-)

--
Hello

I have a Samba share on Raspbian and I'm accessing it from a Windows PC.

When listing the contents of some directories, I get the exception error "Not a valid Win32 FileTime. (parameter 'fileTime')".

This is apparently due to the fact that some files do not have a "LastAccessTime".
The LittleEndianConverter returns the value 9223372036854775807 from the buffer for the FileDirectoryInformation and this is not a valid UtcFileTime.
This behaviour prevents access to all the files of the directory.

I've now pulled a copy of the repository and ignored the errors with returning a MinValue, but of course it would be nice if the official NuGet package also offered this tolerance.

Kind regards
Martin

@TalAloni
Copy link
Owner

Hi Martin,
A similar issue was mentioned in #100
according to the specs LastAccessTime "represents the number of 100-nanosecond intervals that have elapsed since January 1, 1601, Coordinated Universal Time (UTC)".

The value 0x7FFFFFFFFFFFFFFF being used here cannot be represented by C# DateTime.
I would argue that the issue is with Samba, LastAccessTime should be set to the file CreationTime if it's not being tracked.

@Muesli84
Copy link
Author

Muesli84 commented Dec 1, 2024

Hi TalAloni,

Thanks for your reply.

I see. And I agree. But I would also argue that you cannot always control whether other domains you interface with will send well-structured and well-formed data, as specified. One incorrect property value of one file should not prevent access to the entire directory.

Yesterday evening, I bought a new NAS, and now every file seems to have a LastAccessTime. I may be able to reconfigure Samba on my Raspberry Pi, but I would not be able to change the behavior of this new device if misbehaviors like this would happen.

I am using the SMBLibrary for my private application, but having this library in an app for other users would provoke trouble, which could be reduced by considering known possible issues like this.

Just my thoughts.

Kind regards
Martin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants