Page 1 of 1

wc for File class

Posted: Tue Apr 10, 2007 5:56 pm
by bhalterm
is there something similar to wc for the file class? I read through the Programmer's Reference section, but didn't see anything. All I'm trying to do is initialize a vector to the exact length necessary to read values from a given file of doubles. I can think of several reasonable ways to do it, but it seems like there is probably a really really easy way that I'm missing.

Posted: Tue Apr 10, 2007 8:17 pm
by ted
No, but feel free to implement one.

Posted: Wed Apr 11, 2007 9:14 am
by ted
If you're using UNIX/Linux/OS X, or MSWin with an installation of cygwin that includes wc,
you could take advantage of hoc's system() procedure, which makes the OS's shell
execute a command. Also recall that hoc's printf() can be used to assemble command
strings.