News:

MultiCommander v16.6 is released!

Main Menu

v14.0 BETA

Started by Mathias (Author), April 02, 2024, 13:24:58

Previous topic - Next topic

Mathias (Author)

Quote from: Jungle on June 20, 2024, 14:09:47
Quote from: Mathias (Author) on June 20, 2024, 11:20:52
when checking if file exists the GetFileAttributes(..) API is used. But for the special system files it return false and set error code to FILE_NOT_FOUND.

I tried PathFileExists(). For non-existing file it returns 0x02 FILE_NOT_FOUND while for "hiberfil.sys" it returns 0x20 ERROR_SHARING_VIOLATION. Also FindFirstFile() succeedes.

It looks inconsistent when you see a file in the panel, but script says it doesn't exist.
Yes some Windows API report  NOT FOUND and some SHARING VIOLATION..
Its only for some very special system files. Not sure it is worth the time to create some workaround just for them.

Jungle

Quote from: Mathias (Author) on June 20, 2024, 14:54:38
Yes some Windows API report  NOT FOUND and some SHARING VIOLATION..
Its only for some very special system files. Not sure it is worth the time to create some workaround just for them.
Let FileExists() and others return:
* 1 when GetFileAttributes returns true
* 0 when GetFileAttributes returns false and FILE_NOT_FOUND
* 2 (or -1 or whatever else) otherwise

It will guarantee file existence or absence

User_99

Hi Mathias,

thx for update.
Translation strings all fine. Great work...