Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dodo line manipulation #6

Open
chrisosaurus opened this issue Jun 10, 2015 · 3 comments
Open

dodo line manipulation #6

chrisosaurus opened this issue Jun 10, 2015 · 3 comments

Comments

@chrisosaurus
Copy link
Owner

Currently dodo has 2 unimplemented functions parse_line and eval_line

A decision needs to be made on whether or not dodo should support line operations.

Any such operations cannot consume more of the file than needed to process any line instructions as dodo must always be able to operate efficiently on large files (a 16G postgres dump is my current example).

The implementation isn't too complex; when dodo is given the instruction l10 to goto line 10 dodo can keep stepping through the file (in chunks to reduce the overhead of frequent reads) counting \n characters until it has seen 9 and then step 1 character past (so at to be at the start of line 10).

If dodo never finds a line 10 then it is an error (similar to a failed expect).

@chrisosaurus
Copy link
Owner Author

My thinking here is that I do want to be able to say 'goto line 10' (l10) and have dodo behave correctly for this.

A 'small' (1024?) buffer with an fread and counting \n should be sufficient as a naive first attempt.

@chrisosaurus chrisosaurus removed their assignment Sep 24, 2015
@chrisosaurus
Copy link
Owner Author

I will be too busy for a while.

@phillid
Copy link
Contributor

phillid commented Jan 21, 2016

I have this tentatively written (locally), I'll do some more testing and tidying before submitting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants