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

I removed the date command #17

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

I removed the date command #17

wants to merge 11 commits into from

Conversation

m42a
Copy link

@m42a m42a commented Sep 17, 2012

No description provided.

@avleen
Copy link
Owner

avleen commented Sep 20, 2012

Can you merge your changes with the latest code please, and fix the cut? I'd love to merge this :-)

@m42a
Copy link
Author

m42a commented Sep 20, 2012

Actually, with the new architecture, everything but the date stuff is fixed already. The current version should only have the date bits changed (and I think this'll work on older versions of bash).

@ghost
Copy link

ghost commented Sep 21, 2012

Several things:

  • I like the creative use of printf here for the date. We should pull this in.
  • I'm not so sure about the stat change. It's complicated, and inefficient since it has to read the entire file into memory.
  • Could you please provide a branch with cleaner history for pulling? Merging your master branch will include all of your intermediate commits into the project, and they are really not relevant. I'd suggest creating a new branch and cherry-picking the printf change, and re-submitting the pull request.

@m42a
Copy link
Author

m42a commented Sep 21, 2012

Have you tested printf with bash 3.2? I just don't want to issue another request that won't work for avleen.

And Re: the stat change, I'll agree it's inefficient (although not majorly so; it takes less than half a second to size-check a 700K text file) but not for that reason; we have to read the entire file into memory anyway since we're serving it up.

@ab
Copy link
Collaborator

ab commented Sep 21, 2012

What's wrong with using stat? I'd much rather use something that's O(1) rather than O(n) to calculate length. (Note that I also tested using bash's built-in strlen with ${#content}, and it is slower than wc for files of any appreciable size.)

@m42a
Copy link
Author

m42a commented Sep 21, 2012

Nothing is wrong with stat, but it's not built into bash (or guaranteed to exist at all, in fact).

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

Successfully merging this pull request may close these issues.

3 participants