[Toybox] Posix: failing by omission since 1988.

Rob Landley rob at landley.net
Tue Jun 25 23:06:28 PDT 2013


On 06/22/2013 02:32:12 AM, Felix Janda wrote:
> > > > If you split an empty file, does it create one empty output  
> file,
> > > or no
> > > > output files?
> > >
> > > "The split utility shall read an input file and write one or more
> > > output files."
> >
> > So the implementation in ubuntu is nonconforming then?
> 
> I tested also busybox's implementation and looked at Heirloom's and
> FreeBSD's version. It seems to be the consensus not to create an empty
> output file. It is the most natural thing to do in the natural
> algorithm.

Actually mine was creating an empty output file until I adjusted it to  
match their behavior. It's a coin flip, really...

> The description in the '-l' option is also not helpful.
> 
> Maybe file a defect at austingroupbugs?

Feel free. (I subscribe to support Rich Felker's attempt to head off  
some utf8-related stupidity, but as far as I can tell the senior voice  
there is Jorg "Solaris will rise again" Schilling, and I really don't  
want to get any of that on me.)

I treat Posix the same way I treat LSB: as advisory. Something to  
document divergences from. I'm clearly not the only one. (It's a pity  
LSB isn't better,what I really care about is what _linux_ does. Not  
what DEC Ultrix did a quarter-century ago.)

I have used Eunice for the vax, EMX for OS/2, and even had to make  
stuff work under Cygwin once. Nothing will give you a healthy  
disrespect for "standards" like seeing what they're supposedly good for.

Remember: the S-100 systems were standardized. (IEEE 646 was it?) The  
PC systems were merely copying what IBM did, then what Compaq did, then  
copying each other. Guess which won?

> > > > What are the permissions of the new files?
> > >
> > > See above.
> >
> > Again, the implementation in ubuntu is nonconforming. (It copies the
> > permissions from the source file.)
> 
> My Coreutils 8.20 and Busybox don't seem to do that. The GNU one seems
> to stat the file for some reason, Busybox does not. I think that this
> tool should not need to care about permissions, like 'sed "1w file"'.

Except copying the permissions of the input file sort of makes sense  
here. Hmmm...

This one's "8.13-3ubuntu3.2". It's easy enough to drop (and saves 5  
lines of code), I'm just not sure what the right thing to do is...

> Felix

Rob
 1372226788.0


More information about the Toybox mailing list