[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rm hack



On 09 Oct  Alex Kirk wrote:

> Well, this was actually my original thought, but I ran into the
> difficulty of getopt thinking that the filename was an argument to -P.

I don't know offhand. OBSD's getopt() is different than GNU's, which has
a way to indicate that arguments to options are themselves optional (two
colons in the optstring). I should get back to work, so I'll let you
re-read the manual page. :)

> As a follow-up to my question about overwriting with random values,
> I've got some folks on comp.lang.c telling me that I shouldn't need to
> pass in a hex value, just any value in any base that's within range.
> Are they correct? If so, what kind of a range would I need to stay
> within? 

Yes: 16 and 0xF are two representations of the same value. As for what
your value range is, I'd say that since Unix files are streams of bytes,
the range is that of an unsigned char: from 0 to 2 ** 8 (0 -> 256 or
0x00 -> 0xFF).


-- 
Chris