Browsing this Thread:
1 Anonymous Users
|
Re: Directory listing with wildcards
|
||||
|---|---|---|---|---|
|
Home away from home
![]() |
Hi BSzili:
Sorry, a bit late :/ You probably already figured it out yourself, but i hate these kind of loose ends. Quote: BSzili wrote: And this is how you can incorporate the solution to that problem into the initial routine you pointed to (at least i got some desired results, not heavily tested: should work 100% in theory):
Program RecurseFilematch;
Which gives me the following output:
start
Regards, PS: just realized, the ParsePatternNoCase should ofcourse be able to be placed out of while loop to gain more speed.
Posted on: 2012/11/9 8:42
Edited by magorium on 2012/11/10 9:17:40
|
|||
|
||||
|
Re: Directory listing with wildcards
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
I'm not completely sure what the linked source code should do... but I know C:List will not do what you want. You might need something more like "C:Search FILE ALL PATTERN". It might be worthwhile looking at the source for Search.
Posted on: 2012/11/4 18:06
|
|||
|
||||
|
Re: Directory listing with wildcards
|
||||
|---|---|---|---|---|
|
Home away from home
![]() |
/me nodds franticly and gives bszili a high five
![]() That was indeed what i was trying to say. Just to make sure i _suspect_ that is what is happening. I do not seem to remember how this was done in the old days and if it could be solved in one go (matchrun) by changing the flags. From the things i've seen sofar the code you posted does a recursive dir perfectly (#?). Now it only needs a filematch. One of the exmaples even does not use the match-routines but uses the file equivalents and checks them manually, which is ofcourse also a (valid) solution. Sorry to have you confused, i thought it was clear enough from my first explanation. Obviously i need to work on my skills ![]() Just glad you figured it out. Even if that solution from the code you posted could be turned into a working version (doing it one match-run) you now at least know what the difference is/would be ![]() regards, ps: Because i suspected it perhaps not being so easy i haven't got around it to turn the fpc code into using aros functions only. If i would have done i would have a clear solution/answer for you, which i don't have now :(
Posted on: 2012/11/4 14:09
|
|||
|
||||
|
Re: Directory listing with wildcards
|
||||
|---|---|---|---|---|
|
Home away from home
![]() |
I saw those, but it's still not entirely clear. I only learn from examples
![]() Since I figured out the source of the confusion. What I expected from recursively matching for AHX.#? was: Quote:
But what is really does is this: Quote:
So it'll only enter subdirectories which match the AHX.#? wildcard. This is what you've been saying, but I had hard time grasping it ![]()
Posted on: 2012/11/4 13:45
|
|||
|
My AROS&MorphOS ports
Arguments that explain everything... explain nothing. |
||||
|
||||
|
Re: Directory listing with wildcards
|
||||
|---|---|---|---|---|
|
Home away from home
![]() |
@bszili:
again i might be mistaken and there is a simpler way of doing it. but this is how it's done in pascal. Here is more info on amiga, the flags and how they should behave. regards, red: 156 hits in google sux :/ i found this and this, but am not sure if it will help you, so apologies upfront.
Posted on: 2012/11/4 12:36
Edited by magorium on 2012/11/4 13:41:45
|
|||
|
||||
|
Re: Directory listing with wildcards
|
||||
|---|---|---|---|---|
|
Home away from home
![]() |
I think it does. I didn't really understand the API, what APF_DODIR and APF_DIDDIR means, etc. I still don't, but I'm a bit closer with your pascal example.
Posted on: 2012/11/4 12:24
|
|||
|
My AROS&MorphOS ports
Arguments that explain everything... explain nothing. |
||||
|
||||
|
Re: Directory listing with wildcards
|
||||
|---|---|---|---|---|
|
Home away from home
![]() |
In an attempt to have the correct communicationprotocol
![]() in pseusocode this is what i use:
procedure filesearch (pathname, filename: string; Recursive: boolean);
Note the different search patterns when searching e.g. for a specfic extension. Ofcourse if you choose to search * as filename it will match all. Perhaps that makes more sense ? regards,
Posted on: 2012/11/4 9:52
|
|||
|
||||
|
Re: Directory listing with wildcards
|
||||
|---|---|---|---|---|
|
Home away from home
![]() |
Quote:
Then I don't get it. Please keep in mind, that i could be mistaken or that i misunderstood the code. Quote: It shouldn't limit itself to the current directory, but imo the code you pointed to does. It matches a directory based upon the pattern. So if you would actually supply a pattern of e.g. #?.info then which directory would match that ? Exactly zero (unless you are develish and created such directory). on second thought, try creating it and see for yourself ![]() Quote: even if it matches both files and directories. The files must match the pattern (e.g. #?.info) the directories must match #? (all). Quote: My problem is that recursive search only works if you don't specify a pattern, or only give #? as the pattern or somedir/#?. Exactly the behaviour i was expecting. So i am affraid we have a communication-problem here and I have no idea how to solve that :/ Ofcourse i can try to explain further if you want, perhaps we can solve the communication thingy toghether ![]() regards,
Posted on: 2012/11/4 9:20
|
|||
|
||||
|
Re: Directory listing with wildcards
|
||||
|---|---|---|---|---|
|
Home away from home
![]() |
Then I don't get it. It shouldn't limit itself to the current directory, even if it matches both files and directories. My problem is that recursive search only works if you don't specify a pattern, or only give #? as the pattern or somedir/#?.
Posted on: 2012/11/4 9:04
|
|||
|
My AROS&MorphOS ports
Arguments that explain everything... explain nothing. |
||||
|
||||
You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.








