wildcard characters for ls
Hi!
I am trying to implement linux "ls" command just with system calls and until now I have succeded in listing a directory (with a given full path )and taking information about the files in there by opendir,readdir,stat system calls.But I also want to handle the wildcard characters '*' and '?' in the search pattern.Namely select only files which match the pattern containing these wildcards.Is there an easy way in handling that?Thank you:) |
I think you're going to have to tell us what language you are programming in. A little more detail is always useful in getting an answer.
|
I am programming in c++.Thanks again.
|
Quote:
Utilities like ls, however, may need to implement filename matching for correct unix-path expansion. In this case, one might use the POSIX-specified fnmatch(). |
All times are GMT -5. The time now is 07:58 PM. |