Re: a text filter (with a minor problem - help!)

new topic     » goto parent     » topic index » view thread      » older message » newer message

> The original was written in C, but as an experiment I made this Euphoria
> version as well. The program has a built-in timer, and different
> versions of the program gave these results on my computer (filtering a
> 213905-byte text file):
>
> Borland C++ 4.5          6  sec
> Euphoria 1.5            11  sec
> Turbo C 2.0             13  sec
>
> So Euphoria does not do too badly!

Are you sure???? That's great!


> But the program has one fundamental flaw, and I do not know what to do
> about it. To determine the length of the input file, I did
>
> FILE_HANDLE = open (FILE_NAME,"ab")
> FILE_LENGTH = where(FILE_HANDLE)
> close(FILE_HANDLE)
> -- followed by FILE_HANDLE = open (FILE_NAME,"rb")

Use the dir() function instead. One of the return values it gives is
the file size.

>
> but this trick cannot work if the input file is read-only!!! Is there
> another way to find out the length of a file?
>
> section 1 of 1 of file strff.zip  < uuencode 5.32 by R.E.M. >
>
>

Regards,
  Daniel Berstein
  danielberstein at usa.net
  http://www.geocities.com/SiliconValley/Heights/9316

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu