Check if a file is a gzip file
Check if a file is a gzip file
is.gzip(f)
f |
Path to file to test |
logical indicating whether f
is in gzip format (or NA
if the file cannot be accessed)
notgzipfile=tempfile() writeLines('not a gzip', notgzipfile) is.gzip(notgzipfile) con=gzfile(gzipfile<-tempfile(),open='wt') writeLines('This one is gzipped', con) close(con) is.gzip(gzipfile) unlink(c(notgzipfile,gzipfile))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.