Re: using std::system
From: James Dennett (jdennett_at_acm.org)
Date: 10/20/04
- Next message: James Dennett: "Re: Linkst List and Pointer Problem"
- Previous message: Edd: "Re: STL container troubles"
- In reply to: Edo: "Re: using std::system"
- Next in thread: Karl Heinz Buchegger: "Re: using std::system"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 19 Oct 2004 20:45:53 -0700
Edo wrote:
> Anand Hariharan wrote:
>
>> "Chris \( Val \)" <chrisval@bigpond.com.au> wrote in message
>> news:<2tkh30F1vkjm2U1@uni-berlin.de>...
>>
>>> "Alwyn" <dt015a1979@mac.com.invalid> wrote in message
>>> news:191020041223380836%dt015a1979@mac.com.invalid...
>>> | In article <cl2sit$3ta$1@news-02.connect.com.au>, Edo
>>> | <eddod@eddododod.dod> wrote:
>>> | >
>>> | > I should rewrite this... I understand what the system rutine
>>> takes, but
>>> | > how can I pass variables as filenames here.
>>> |
>>
>>
>>
>> [bunches of good advice pertinent to OP's question snipped]
>>
>> To the OP -
>> Why not simply write code that counts the number of lines in 'infile'?
>> wc may be faster, but having to execute that command, and open the
>> outfile to read the result, and parse it for the number all is going
>> to offset the speed-gains.
>>
>> my $0.02,
>> - Anand
>
> sure, I tried, it worked only if the file size is with in a limit, but
> say you have a file with 2000000 lines or 400Mb the loop to count would
> take a loooooooong time.
That's what wc does, and it's generally written in C.
-- James
- Next message: James Dennett: "Re: Linkst List and Pointer Problem"
- Previous message: Edd: "Re: STL container troubles"
- In reply to: Edo: "Re: using std::system"
- Next in thread: Karl Heinz Buchegger: "Re: using std::system"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|