regular / unbzip2-stream

streaming unbzip2 implementatio in pure javascript for node and browsers
Other
29 stars 23 forks source link

Problem with 'dd' in prepare-long-test #12

Closed lurch closed 7 years ago

lurch commented 7 years ago

In package.json you use dd ... bs=5m ... (i.e. lowercase 'm'). But on Ubuntu 14.04 this doesn't work and you have to use 5M instead.

(This is only a minor issue, so feel free to close as irrelevant)

regular commented 7 years ago

Thanks! Only tested on OSX. Unfortunately, the BSD version of dd can't live with an uppercase M. And then there's this open issue: npm/npm#2006. We could switch to npm-package-scripts. Or leave it as it is. Any suggestions?

lurch commented 7 years ago

I guess one way to fix the m-vs-M problem would be to replace 5m with 5242880, but that's kinda ugly!

I'm a newcomer to Node / NPM / JS so have no suggestions in that area :)

regular commented 7 years ago

H ha, right, why didn't I come up with this solution? From man dd

Where sizes are specified, a decimal, octal, or hexadecimal number of
 bytes is expected.  If the number ends with a ``b'', ``k'', ``m'', ``g'',
 or ``w'', the number is multiplied by 512, 1024 (1K), 1048576 (1M),
 1073741824 (1G) or the number of bytes in an integer, respectively.  Two
 or more numbers may be separated by an ``x'' to indicate a product.

So we could use 5x1024x1024 (if thats supported by the gnu flavour)

lurch commented 7 years ago

On my system man dd says:

       N and BYTES may be followed by the following multiplicative suffixes: c
       =1, w =2, b =512, kB =1000, K =1024, MB =1000*1000, M =1024*1024, xM =M
       GB =1000*1000*1000, G =1024*1024*1024, and so on for T, P, E, Z, Y.

I just did a quick test, and yes 5x1024x1024 works :-D Must be an undocumented feature. (and 5*1024*1024 doesn't work)