Skip to content

Commit 7cece1a

Browse files
committed
[ci skip] Document mtime header behavior
This was discussed in rails/sprockets#197. The behavior and results of setting mtime via this method were unclear. This document should help clarify the behavior.
1 parent a8fb40d commit 7cece1a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

ext/zlib/zlib.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3221,7 +3221,20 @@ rb_gzfile_set_lineno(VALUE obj, VALUE lineno)
32213221
* Document-method: Zlib::GzipWriter#mtime=
32223222
*
32233223
* Specify the modification time (+mtime+) in the gzip header.
3224-
* Using a Fixnum or Integer
3224+
* Using a Fixnum or Integer.
3225+
*
3226+
* Setting the mtime in the gzip header does not effect the
3227+
* mtime of the file generated. Different utilities that
3228+
* expand the gzipped files may use the mtime
3229+
* header. For example the gunzip utility can use the `-N`
3230+
* flag which will set the resultant file's mtime to the
3231+
* value in the header. By default many tools will set
3232+
* the mtime of the expanded file to the mtime of the
3233+
* gzipped file, not the mtime in the header.
3234+
*
3235+
* If you do not set an mtime, the default value will be the time
3236+
* when compression started. Setting a value of 0 indicates
3237+
* no time stamp is available.
32253238
*/
32263239
static VALUE
32273240
rb_gzfile_set_mtime(VALUE obj, VALUE mtime)

0 commit comments

Comments
 (0)