Date: Fri, 30 Nov 2018 11:34:22 +0000 From: Alexey Dokuchaev <danfe@freebsd.org> To: Eugene Grosbein <eugen@freebsd.org> Cc: Baptiste Daroussin <bapt@freebsd.org>, Maxim Sobolev <sobomax@freebsd.org>, src-committers <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, Steven Hartland <steven.hartland@multiplay.co.uk>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, Cy Schubert <Cy.Schubert@cschubert.com> Subject: Re: svn: head/usr.bin: . trim Message-ID: <20181130113422.GA14353@FreeBSD.org> In-Reply-To: <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org> References: <20181130011713.42B641D27@spqr.komquats.com> <0e233c0c-6c80-4618-9618-48162362a849@multiplay.co.uk> <20181130084955.o4loxtuswdsvzksy@ivaldir.net> <20181130105714.GA84052@FreeBSD.org> <15e4f063-d081-9c38-be3e-44bc622cc50e@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 30, 2018 at 06:12:12PM +0700, Eugene Grosbein wrote: > 30.11.2018 17:57, Alexey Dokuchaev wrote: > > On Fri, Nov 30, 2018 at 09:49:55AM +0100, Baptiste Daroussin wrote: > >> On Fri, Nov 30, 2018 at 08:31:17AM +0000, Steven Hartland wrote: > >>> Personally I disagree, chances of people finding that option in dd > >>> is slim, a dedicated trim utility makes much more sense to me. Sure > >>> have both that's cool but keep the trim would be my vote. > > > > Having both is OK when there's no code duplication involved (e.g. like > > hd(1) being a handy hardlink to hexdump(1)), yet again... > > > >> I also like the idea of a simple dedicated tool with an obvious name. > > > > ... "Obvious" names can cut both ways. They can be too generic and thus > > create a clash in the future. They can be ambiguous ("trim" can just as > > easily be a tool that excessive whitespace from text files). > > In theory, it can. In practice, it did not for 25 years of FreeBSD > existence despite of whitespace processing being much more generic task. > > Maybe that's because we already have "fmt -s" since 3BSD to do that? :-) Actually, while perhaps whitespace trimming was not the best example (no surprise given it was my first idea of "trimming" other than trimming a beard), your reply is quite helpful: text formatter tasks of different kinds are grouped under one fmt(1) tool. Likewise, dd(1) is what people normally use when talking to storage media. How often does average Joe user need to explicitly trim their flash disks to warrant a dedicated "trim" utility in the base? Shouldn't it just happen automagically most of the times, and require some manual intervention under some specific circumstances? Another point: the manpage says, "It is only relevant for flash based storage devices that use wear-leveling algorithms", which is an argument against generic "trim". I would mind less of it would be called ftrim(8) or ssd_trim(8) or flash_trim(8), but still prefer Maxim's approach. ./danfe
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181130113422.GA14353>