I am trying to simulate the behavior of linux commandline command
rm a1*.txt
using either wildcards or regular expressions, inside a C program (linux gcc).
Is there a standard way of doing that?
If you're on a POSIX system, you can use glob()
to expand such a pattern.
Then, of course, use the standard remove()
function to do the deletion.