Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Error: sh: cannot duplicate fd 31 to fd 0: Bad file descriptor
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="James Kuyper, post: 3704868"] The command string you're passing to system() contains many features that suggest it's intended for a Unix-like system such as Linux, most particularly the 'ls' and 'grep' commands. You could have programs named 'ls' and 'grep' installed on your computer, but they are not a built-in part of Windows. Even if you do have such programs, the way wild cards are handled by the Windows command interpreter is substantially different from the way that they are handled by typical Unix shells, so those functions couldn't be exact substitutes for the unix commands. If you want to learn what the Windows equivalents of 'ls' and 'grep' are, the best place to ask would be a Windows-specific newsgroup. If you're willing to write a Windows-specific program, I believe that there are functions you can call that will provide you with the directory list directly, rather than dumping it into a file. Whether those functions would be useful to you depends upon what your program does with that file. Again, the best place to ask is a newsgroup specifically for Windows. If you want to learn a way of doing that which works equally well on all C implementations, you're out of luck. Sorry! [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Error: sh: cannot duplicate fd 31 to fd 0: Bad file descriptor
Top