Multi Commander > Script
_FindFirstFile strange behaviour
(1/1)
Jungle:
I have the following code:
--- Code: ---$s = AskText("Enter file name", "New file.txt", 0);
Log(0, 10, GetSourcePath() + $s);
Log(0, 10, _findfirstfile(GetSourcePath() + $s));
--- End code ---
When i pass exact file name fo _FindFirstFile function, it finds nothing. But when i pass file mask, it finds that file:
--- Code: ---012-05-14 15:46:21.192 D:\1\New file 1.txt
2012-05-14 15:46:21.192 Script engine - _FindFirstFile : 'D:\1\' - 'New file 1.txt'
2012-05-14 15:46:21.192 Script engine - _FindFirstFile found nothing
2012-05-14 15:46:21.192
2012-05-14 15:46:32.052 D:\1\*.txt
2012-05-14 15:46:32.052 Script engine - _FindFirstFile : 'D:\1\' - '*.txt'
2012-05-14 15:46:32.052 Script engine - Match found _FindFirstFile found : 'D:\1\New file 1.txt'
2012-05-14 15:46:32.052 D:\1\New file 1.txt
--- End code ---
Is it a bug?
--
P.S. Where can i find list of the internal commands like _FindFirstFile? I haven't found it in online documentation. Maybe i've overlooked?
Mathias (Author):
_findfirstfile match by using a wildcard filter. So when using exact name it fails so it is a bug.
Anohter The "Problem" with _FindFirstFile is that it only support local file system. I was planing to add so that used the virtual filesystem layer in MC. So that all file systems that is supported in MC could be used.. Like Ftp, Zip, and so on. But I never got the time.
Thats wait it also is missing from the online doc. But I will add it to the documentation. and fix the pattern matching issue.
I have a couple of script issue Im planing on fixing soon, So if there is any script functions you are missing let me know.
Jungle:
--- Quote from: Mathias (Author) on May 14, 2012, 14:50:07 ---So if there is any script functions you are missing let me know.
--- End quote ---
I have not tried yet, but i wonder wheter it is possible to use do...while loop.
--- Code: ---do {
...
} while ( ... );
--- End code ---
Online doc only has example of while loop.
Mathias (Author):
--- Quote from: Jungle on May 14, 2012, 15:03:22 ---I have not tried yet, but i wonder wheter it is possible to use do...while loop.
--- End quote ---
No Do-While is not supported. And I kind of skipped that because it is not necessary, You can do most thing with the for and while loops. But it would be nice to have. But adding new core function like Do-While to the script engine is time consuming because it is so easy to break the code and it also require so must testing.
I do have a lot of automated tests for the script engine but even so cost of time is to great at the moment There are a lot of other features that are more importent.
However adding library functions (like _FindFirstFile, and other function that are not part of the core language) to the script language is cheap.
Jungle:
--- Quote from: Mathias (Author) on May 14, 2012, 15:49:52 ---However adding library functions (like _FindFirstFile, and other function that are not part of the core language) to the script language is cheap.
--- End quote ---
Thanks, will keep it in mind.
Navigation
[0] Message Index
Go to full version