# Avoid disk write when reading gzipped file from s3

**URL:** https://discourse.julialang.org/t/avoid-disk-write-when-reading-gzipped-file-from-s3/95836
**Category:** General Usage
**Created:** [March 10, 2023, 2:21am UTC](https://discourse.julialang.org/t/avoid-disk-write-when-reading-gzipped-file-from-s3/95836 "2023-03-10T02:21:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ilanggear](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ilanggear/32/862_2.png) [@ilanggear](https://discourse.julialang.org/u/ilanggear)
#### Post date: [March 10, 2023, 2:21am UTC](https://discourse.julialang.org/t/avoid-disk-write-when-reading-gzipped-file-from-s3/95836/1 "2023-03-10T02:21:58Z")

</div>

I have a goal similar to the following thread, but my data is gzipped text, not tiff. [Retrieve data from Amazon S3?](https://discourse.julialang.org/t/retrieve-data-from-amazon-s3/29959/10).

I want to read many 130M gzipped text files from s3 one by one, unzip each file, extract a regex match (to be stored later) and then discard the s3 file without ever writing to disk.

So I have this attempt:  
`for line in ZipFile.Reader(load(Stream(format"GZ", IOBuffer(s3obj)))) ` but I’m getting `ERROR: LoadError: No applicable_loaders found for GZ`

I also tried this variant:  
`for fname in ZipFile.Reader(FileIO.load(IOBuffer(obj)))` with this result: `ERROR: LoadError: ArgumentError: Unrecognized RDA formatd��Yconll.paths.csv��14�r���{�}��b��P��ރ}mdIi��Yτ���t���/�������������׿��o�����������ן�����?��?��_����_���?������_��� �$l"`

Is there a way to do what I want?

---

<div class="post-metadata">

### Author: ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)
#### Post date: [March 10, 2023, 2:35am UTC](https://discourse.julialang.org/t/avoid-disk-write-when-reading-gzipped-file-from-s3/95836/2 "2023-03-10T02:35:40Z")

</div>

I would try `GzipDecompressorStream` from [GitHub - JuliaIO/CodecZlib.jl: zlib codecs for TranscodingStreams.jl.](https://github.com/JuliaIO/CodecZlib.jl) instead of ZipFile

---

<div class="post-metadata">

### Author: ![ilanggear](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ilanggear/32/862_2.png) [@ilanggear](https://discourse.julialang.org/u/ilanggear)
#### Post date: [March 10, 2023, 3:03am UTC](https://discourse.julialang.org/t/avoid-disk-write-when-reading-gzipped-file-from-s3/95836/3 "2023-03-10T03:03:05Z")

</div>

That was the missing link. Thanks!!
