Multi Commander > Beta Releases

v14.0 BETA

<< < (6/6)

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.
--- End quote ---

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.

--- End quote ---
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.

--- End quote ---
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...

Navigation

[0] Message Index

[*] Previous page

Go to full version