|
Forum Index : Microcontroller and PC projects : Micromite Plus: DIR$(fspec) bug with long fspec file name
| Author | Message | ||||
| erbp Senior Member Joined: 03/05/2016 Location: AustraliaPosts: 195 |
I guess this one will be for Geoff. Using MMBasic 5.05.02 Beta 1 on a MM+ (E100) I have found that the DIR$(fspec) function incorrectly reports that a file does NOT exist when it's name is entered as the fspec parameter and the file name is longer than 31 characters. The same applies if using wildcards in the fspec parameter too - see below. Micromite Plus MMBasic Ver 5.05.02 Beta 1 Copyright 2011-2018 Geoff Graham > CHDIR "LOGS" > FILES A:/LOGS 743 Test12345678901234567890123.log 743 Test123456789012345678901234.log 0 directories, 2 files > > DIM FN$ > FN$ = DIR$("Test12345678901234567890123.log",file): ? FN$ <ok with fspec at 31 chars Test12345678901234567890123.log > FN$ = DIR$("Test123456789012345678901234.log",file): ? FN$ <no match if fspec > 31 chars > FN$ = DIR$("Test12345678901234567890123*.log",file): ? FN$ > FN$ = DIR$("Test123456789012345678901234.lo*",file): ? FN$ > FN$ = DIR$("Test123456789012345678901234.*",file): ? FN$ <ok, when fspec shorter again Test123456789012345678901234.log > Regards, Phil |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10573 |
The maximum filename length for pattern matching is 31 characters - just a question of memory usage |
||||
| erbp Senior Member Joined: 03/05/2016 Location: AustraliaPosts: 195 |
Hi Peter, Thanks do you know if that is specified in any of the manuals? I looked before I posted but couldn't find anything that appeared relevant. Did I miss it? Phil. |
||||
| Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3308 |
No, it is not mentioned anywhere... one of those things that slipped past. I will remove this limitation in the next version. Geoff Geoff Graham - http://geoffg.net |
||||
| erbp Senior Member Joined: 03/05/2016 Location: AustraliaPosts: 195 |
Hi Geoff, Thanks - I understand if there does need to be some limitation on the pattern matching that can be applied, but if there is then it should throw an error if that limit is exceeded - not just return an incorrect answer which the calling code will interpret as being fact. Cheers, Phil. |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |