I get an error with this istruction:
dp = opendir ("%APPDATA%/.");
output:
Couldn't open directory: Mo such file or directory.
but I don’t get an erro with this istruction:
dp = opendir ("C:/Users/xrobot/AppData/.");
output:
.
..
Local
LocalLow
Roaming
Why ?
opendirdoesn’t expand meta variables like%APPDATA%, the shell does. So such things work from the command line, but not from a program. In your program, you have to use an absolute or relative path.You can probably obtain the required path with
getenv(),