I have having a bit of a problem with this.
What I am trying to do is to output the contents of a folder into a file (to get a directory listing)as follows:-
The below code works fine.
However if the folder/directory name is long as in the following:-Code:system("dir 2e6d1\*.log /b /s >dirs.doc");
It gives a file not found error, because it does not like the long folder name.Code:system("dir 2e6d1763e3000000\*.log /b /s >dirs.doc");
I am using the djgpp C compiler (where you compile with GCC).
I only get the error when I run the command from within a C program via a system command, if I run the same command from the keyboard (via a batch file) it works fine.
It seems, the C program is using a different 'shell' or whatever you call it (the thing which executes commands), so how do I get it to use the command interpreter which 'likes' long filenames.
TIA