JuliaIO / GZip.jl

A Julia interface for gzip functions in zlib
https://juliaio.github.io/GZip.jl/dev
MIT License
39 stars 30 forks source link

GZip shouldn't prompt the user to overwrite an existing file #34

Closed jiahao closed 9 years ago

jiahao commented 9 years ago

If you GZip.open an existing file in "wb" mode, it prompts you at the console if you want to overwrite it, regardless of isinteractive().

shell> touch random.gz

julia> using GZip; GZip.open("random.gz", "wb")
random already exists -- do you wish to overwrite (y or n)?

I don't think we should do this. Instead we should follow the Linux Standard Base Specification, which says:

The mode argument is based on that of fopen()

i.e. it should follow C convention to silently truncate to zero length.

jiahao commented 9 years ago

Oh wait nevermind this was a completely different problem in my test script. Sorry.