What happens when you tail a 32 gig file?
From a glance at the code [0], it looks like it will read it all into memory first. A better way to do this would be to utilize the io.Reader interface. [0] https://github.com/polegone/gonix/blob/0b65cd4fb9c6c44357d0a...
Gonix – Unix tools written in Go
21–30 of 85 posts
Re: Gonix – Unix tools written in Go
#22Silly me. Maybe it makes sense now.
Re: Gonix – Unix tools written in Go
#23Re: Gonix – Unix tools written in Go
#24https://github.com/uiri/coreutils .>
While I'm not sure if he posts here, I used to work in the same group with Jim Meyering, who maintained/maintains coreutils. Great guy. Anyway, he told some great stories of the complexities of POSIX, and what happens in Solaris when you have directories 20,000 lines deep (and how to do it efficently, and the fun of teaching various coreutils commands about SELinux). Lots of it gets surprisingly low level quick. Core…
Re: Gonix – Unix tools written in Go
#25Forget the haters, this is awesome. GNU started as GNU's Not Unix, reimplementing Unix userland for free. The people who are adamant about calling it GNU/Linux are, on some level, remembering that the userspace is historically a reimplementation. Give me a busybox that I can 'go build' and that becomes really quite interesting.
Re: Gonix – Unix tools written in Go
#26There is no reason to ever want to do this.
I'm just doing this for fun and to learn about Go and Unix at the same time. I am a beginner, and a lot of my code is inefficient and/or incomplete, but by putting it on the Internet I can get criticism and find out where I went wrong. For instance, some of you have told me that the way I've been reading files is very inefficient, so now I'll try and do it the correct way.
Re: Gonix – Unix tools written in Go
#27Nice, I was thinking of doing something like that, but I don't know as many unix tools as the author does. :-P
Re: Gonix – Unix tools written in Go
#28Re: Gonix – Unix tools written in Go
#29Earlier quoted context omitted.
From a glance at the code [0], it looks like it will read it all into memory first. A better way to do this would be to utilize the io.Reader interface. [0] https://github.com/polegone/gonix/blob/0b65cd4fb9c6c44357d0a...
Thank you. I will look into this.
Re: Gonix – Unix tools written in Go
#30Earlier quoted context omitted.
While I'm not sure if he posts here, I used to work in the same group with Jim Meyering, who maintained/maintains coreutils. Great guy. Anyway, he told some great stories of the complexities of POSIX, and what happens in Solaris when you have directories 20,000 lines deep (and how to do it efficently, and the fun of teaching various coreutils commands about SELinux). Lots of it gets surprisingly low level quick. Core…
agreed! so many folks see all that stuff as "bloat". In many cases, that code is there for a reason.
Good engineering makes good tradeoffs, rather than throwing in everything anyone wants.
(Not that I think this effort in go is "awesome". For one, it's probably bigger executables than even statically linked coreutils. The suckless sbase/ubase have some real potential though.)