H
hokieghal99
I wish to place all files and directories that are within a user defined
path (on a Linux x86 PC) into some type of array and then examine those
items for the existence of certain charaters such as "*?<>/\|\\" If one
of the chars are found, I'd like to replace it with a "-" and then
commit the change to the actual file system. I know that a scripting
language may be better suited for this, but I'm experimenting with C and
I'm trying to learn how to better use it. Here are my questions:
1. How would I collect all of the file and dir names from a specific path?
2. What type of array should I place them in?
Here is why I ask the second question. I know that C has no built-in
type for strings. I know that it uses a char array to make a string. So,
a filename would be a char array (string), right? This is where I do not
understand how to create an array of char arrays (strings). Any
pointers? I am new at C, so forgive my ignorance.
Thanks!!!
path (on a Linux x86 PC) into some type of array and then examine those
items for the existence of certain charaters such as "*?<>/\|\\" If one
of the chars are found, I'd like to replace it with a "-" and then
commit the change to the actual file system. I know that a scripting
language may be better suited for this, but I'm experimenting with C and
I'm trying to learn how to better use it. Here are my questions:
1. How would I collect all of the file and dir names from a specific path?
2. What type of array should I place them in?
Here is why I ask the second question. I know that C has no built-in
type for strings. I know that it uses a char array to make a string. So,
a filename would be a char array (string), right? This is where I do not
understand how to create an array of char arrays (strings). Any
pointers? I am new at C, so forgive my ignorance.
Thanks!!!