Problems with List command

A forum for general AmigaOS 4.x support questions that are not platform-specific
User avatar
thomasrapp
Posts: 318
Joined: Sun Jun 19, 2011 12:22 am

Re: Problems with List command

Post by thomasrapp »

colinw wrote: % Matches 0 characters always. Useful as in "(foo|bar|%)".
I don't see the use of the % sign. (foo|bar|) works as well. Combinations with other patterns like #% do not make much sense, too.
'#'? matches only the literal string "#?"
This explanation is wrong IMHO. It matches the literal # followed by any single character because only the # is escaped the ? should be interpreted as pattern.
Any of the above characters used in a pattern name usually cause "issues" and requires the use of the
neutralizing character ' to disarm them when part of a filesystem object name itself.
That's useless advice in case of List because the user has no means to insert ' characters if the pattern is read from the file system by MatchNext(). MatchNext() needs to be fixed.
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1744
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: Problems with List command

Post by nbache »

thomasrapp wrote:
colinw wrote: '#'? matches only the literal string "#?"
This explanation is wrong IMHO. It matches the literal # followed by any single character because only the # is escaped the ? should be interpreted as pattern.
I see an apostrophe also in front of the question mark, so I believe Colin is right.
Any of the above characters used in a pattern name usually cause "issues" and requires the use of the
neutralizing character ' to disarm them when part of a filesystem object name itself.
That's useless advice in case of List because the user has no means to insert ' characters if the pattern is read from the file system by MatchNext().
Which - I guess - is one of the aforementioned "issues" and a good reason to avoid using those characters in filenames.
MatchNext() needs to be fixed.
To do what?

Beast regards,

Niels
User avatar
thomasrapp
Posts: 318
Joined: Sun Jun 19, 2011 12:22 am

Re: Problems with List command

Post by thomasrapp »

see an apostrophe also in front of the question mark, so I believe Colin is right.
I don't see much this week because my glasses are broken. So yes, if there is an apostrophe in front of the ? then it should be escaped, too.
To do what?
To not parse file names encountered during directory read for pattern characters.

The user can input something like SYS:#?/Monitors with the intention to find SYS:Devs/Monitors and SYS:Storage/Monitors. Now if MatchNext() finds SYS:Devs(deactivated)/Monitors in the file system it should take it just like this and enter the directory. It should not try to find pattern characters in the file name.

It should match the file against the pattern and not the other way round. I don't see a reason why it would need to parse the file name. There cannot be partterns in file names. File names have to be unique.
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1744
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: Problems with List command

Post by nbache »

thomasrapp wrote:The user can input something like SYS:#?/Monitors with the intention to find SYS:Devs/Monitors and SYS:Storage/Monitors. Now if MatchNext() finds SYS:Devs(deactivated)/Monitors in the file system it should take it just like this and enter the directory. It should not try to find pattern characters in the file name.

It should match the file against the pattern and not the other way round. I don't see a reason why it would need to parse the file name. There cannot be partterns in file names. File names have to be unique.
This is exactly what it does, as far as I can see.

I cloned my SYS:Devs to SYS:Devs(deactivated) and did a List SYS:#?/Monitors, and it showed me the following:

Code: Select all

Kataloget "SYS:Devs(deactivated)" - Mandag 25-Nov-13
Monitors                        Kat ----rwed 05-Dec-12 19:50:11
1 katalog - 2 blokke benyttet

Kataloget "SYS:Storage" - Mandag 25-Nov-13
Monitors                        Kat ----rwed 01-Jan-78 02:01:14
1 katalog - 2 blokke benyttet

Kataloget "SYS:Devs" - Mandag 25-Nov-13
Monitors                        Kat ----rwed 05-Dec-12 19:50:11
1 katalog - 2 blokke benyttet
To be sure, I tried it on my public release partition (not the beta one), and it does work.

I'm not sure whether this is a recent fix, but it should work like this for you too (if your system is up to date).

Best regards,

Niels
User avatar
thomasrapp
Posts: 318
Joined: Sun Jun 19, 2011 12:22 am

Re: Problems with List command

Post by thomasrapp »

Try with the ALL keyword as in the original post.
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1744
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: Problems with List command

Post by nbache »

Ah ... :roll:

Missed that part - sorry.

Code: Select all

> List SYS:#?/Monitors all
Kataloget "SYS:Devs(deactivated)" - Tirsdag 26-Nov-13
Monitors                        Kat ----rwed 05-Dec-12 19:50:11
1 katalog - 2 blokke benyttet

Kataloget "SYS:Storage" - Tirsdag 26-Nov-13
Monitors                        Kat ----rwed 01-Jan-78 02:01:14
1 katalog - 2 blokke benyttet

Kataloget "SYS:Devs" - Tirsdag 26-Nov-13
Monitors                        Kat ----rwed 05-Dec-12 19:50:11
1 katalog - 2 blokke benyttet
LIST: Ingen oplysninger om "SYS:Devs(deactivated)/Monitors".
LIST: objektet findes ikke

I ALT: 3 kataloger - 6 blokke benyttet
I agree - this looks strange.

Best regards,

Niels
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 6:47 pm
Contact:

Re: Problems with List command

Post by JosDuchIt »

@nbache
Did you also note my observation valid for tests with the ALL keyword
The curious thing is this
- when i compose a litigious name to save under, Notepad accepts it and list recognizes it correctly (
- i can type in the exact litigious names i did find on my HD and save them to ram: or a subfolder: list will acceppt them
- when i save to ram: the folders in which i did find the litigious name "list"chokes on it
I did not test this on dir names, but i don't see why this would be different.
You can copy the names i tested below & give them to a directory or a file, that's what i did too, to be sure
« _Audio/AMC/Themes/Default (16-9_LessFX) »
« Cinnamon_Writer_0.801/Dictionary/English|en-uk ».


In the first you can think some non standard blank character replaced the correct "blank"
I doubt this to be the case for the "|" character

So yes i think in some cases even with ALL list works as it should and in other cases not, depending on how the name was registered.
Post Reply