Multi Commander > Beta Releases
v14.0 BETA
Jungle:
--- Quote from: Mathias (Author) on June 20, 2024, 09:13:34 ---
I don't see it losing defined scripables columns. have you checked the option for the script to be a FileProp?
--- End quote ---
Thanks. Checking this option works.
But there's another issue. Some multiscript functions fails with certain files. E.g. FileExists returns 0 for "hiberfil.sys", "pagefilt.sys", "swapfile.sys". And IsFolder fails with script engine error.
This sample code: will variable be visible out of its scope?
--- Code: ---if(IsVariableDefined("$_FILEPROP_FILEPATH") == 0)
{
@var $_FILEPROP_FILEPATH = GetTargetFocusPath();
}
--- End code ---
Mathias (Author):
--- Quote from: Jungle on June 20, 2024, 10:01:37 ---
--- Quote from: Mathias (Author) on June 20, 2024, 09:13:34 ---
I don't see it losing defined scripables columns. have you checked the option for the script to be a FileProp?
--- End quote ---
Thanks. Checking this option works.
But there's another issue. Some multiscript functions fails with certain files. E.g. FileExists returns 0 for "hiberfil.sys", "pagefilt.sys", "swapfile.sys". And IsFolder fails with script engine error.
This sample code: will variable be visible out of its scope?
--- Code: ---if(IsVariableDefined("$_FILEPROP_FILEPATH") == 0)
{
@var $_FILEPROP_FILEPATH = GetTargetFocusPath();
}
--- End code ---
--- End quote ---
it should be "@gvar" to force defined a global. But that branch is not merged. Will fix that tonight.
IsFolder() works for me
If FileExists return 0 then Windows return error when checking for those special file. Windows actually return ERROR_FILE_NOT_FOUND when trying to check those files.
Jungle:
--- Quote from: Mathias (Author) on June 20, 2024, 10:48:07 ---If FileExists return 0 then Windows return error when checking for those special file. Windows actually return ERROR_FILE_NOT_FOUND when trying to check those files.
--- End quote ---
But MC somehow shows that files in Explorer Panels. If it can detect them, then I don't see a reason why MultiScript's FileExists could not.
Try IsFolder() for "hiberfil.sys"
Mathias (Author):
--- Quote from: Jungle on June 20, 2024, 11:13:37 ---
--- Quote from: Mathias (Author) on June 20, 2024, 10:48:07 ---If FileExists return 0 then Windows return error when checking for those special file. Windows actually return ERROR_FILE_NOT_FOUND when trying to check those files.
--- End quote ---
But MC somehow shows that files in Explorer Panels. If it can detect them, then I don't see a reason why MultiScript's FileExists could not.
Try IsFolder() for "hiberfil.sys"
--- End quote ---
Listing all files just to see if a file exists is not efficient. It is very slow.
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.
Jungle:
--- 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.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version