[Scilab-users] Scan file backward from the end?
Serge Steer
serge.steer at inria.fr
Wed Mar 20 23:43:18 CET 2013
If you know the approximate size of the footer in number of bytes (assume N greater than it) you can try to set the pointer N bytes before the end of file using the
u=mopen("myfile");
mseek(-N,u,'end')
then read the rest with
mgetl(-1,u)
Serge
----- Mail original -----
> De: "Antoine Monmayrant" <amonmayr at laas.fr>
> À: users at lists.scilab.org
> Envoyé: Mercredi 20 Mars 2013 22:59:55
> Objet: [Scilab-users] Scan file backward from the end?
>
> Hi all,
>
> Do any of you know an efficient way to scan a text file backward from
> the end in scilab?
> I want to load into scilab text data (a footer) that is situated in a
> file after a big binary blob of variable length (a huge tiff image).
> For the moment I scan line by line from the top and test whether it
> looks like the start of the footer.
> It works but it is terribly slow as I have to scan the whole binary
> blob.
> Any idea on how I could do the same more efficiently using only
> scilab functions (to stay portable for my colleagues running scilab
> on Windows)?
>
> Cheers,
>
> Antoine
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
More information about the users
mailing list