"Fossies" - the Fresh Open Source Software Archive

Member "libzip-1.6.0/man/zip_file_set_mtime.mdoc" (24 Jan 2020, 3879 Bytes) of package /linux/misc/libzip-1.6.0.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "zip_file_set_mtime.mdoc": 1.5.2_vs_1.6.0.

    1 .\" zip_file_set_mtime.mdoc -- set mtime for file in zip
    2 .\" Copyright (C) 2014-2020 Dieter Baron and Thomas Klausner
    3 .\"
    4 .\" This file is part of libzip, a library to manipulate ZIP files.
    5 .\" The authors can be contacted at <libzip@nih.at>
    6 .\"
    7 .\" Redistribution and use in source and binary forms, with or without
    8 .\" modification, are permitted provided that the following conditions
    9 .\" are met:
   10 .\" 1. Redistributions of source code must retain the above copyright
   11 .\"    notice, this list of conditions and the following disclaimer.
   12 .\" 2. Redistributions in binary form must reproduce the above copyright
   13 .\"    notice, this list of conditions and the following disclaimer in
   14 .\"    the documentation and/or other materials provided with the
   15 .\"    distribution.
   16 .\" 3. The names of the authors may not be used to endorse or promote
   17 .\"    products derived from this software without specific prior
   18 .\"    written permission.
   19 .\"
   20 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
   21 .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   22 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
   24 .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
   26 .\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   27 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
   28 .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
   29 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
   30 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   31 .\"
   32 .Dd January 7, 2020
   33 .Dt ZIP_FILE_SET_MTIME 3
   34 .Os
   35 .Sh NAME
   36 .Nm zip_file_set_dostime ,
   37 .Nm zip_file_set_mtime
   38 .Nd set last modification time (mtime) for file in zip
   39 .Sh LIBRARY
   40 libzip (-lzip)
   41 .Sh SYNOPSIS
   42 .In zip.h
   43 .Ft int
   44 .Fn zip_file_set_dostime "zip_t *archive" "zip_uint64_t index" "zip_uint16_t dostime" "zip_uint16_t dosdate" "zip_flags_t flags"
   45 .Ft int
   46 .Fn zip_file_set_mtime "zip_t *archive" "zip_uint64_t index" "time_t mtime" "zip_flags_t flags"
   47 .Sh DESCRIPTION
   48 The
   49 .Fn zip_file_set_mtime
   50 function sets the last modification time (mtime) for the file at
   51 position
   52 .Ar index
   53 in the zip archive to
   54 .Ar mtime .
   55 Currently, no support for any
   56 .Ar flags
   57 is implemented.
   58 .Pp
   59 In the zip archive, the time and date are saved as two 16-bit integers.
   60 To set the values directly, call the
   61 .Fn zip_file_set_dostime
   62 function.
   63 The values of the time bytes are defined as follows:
   64 .Bl -tag -width 5n -offset indent
   65 .It 0-4
   66 day of the month (1-31)
   67 .It 5-8
   68 month (January = 1, February = 2, ...)
   69 .It 9-15
   70 year offset from 1980 (1980 = 0, 1981 = 1, ...)
   71 .El
   72 .Pp
   73 The values of the date bytes are defined as follows:
   74 .Bl -tag -width 5n -offset indent
   75 .It 0-4
   76 seconds divided by two (1-2 = 1, 3-4 = 2, ...)
   77 .It 5-10
   78 minute (0-59)
   79 .It 11-15
   80 hour (0-23)
   81 .El
   82 .Sh RETURN VALUES
   83 Upon successful completion 0 is returned.
   84 Otherwise, \-1 is returned and the error information in
   85 .Ar archive
   86 is set to indicate the error.
   87 .Sh ERRORS
   88 .Fn zip_file_set_dostime
   89 and
   90 .Fn zip_file_set_mtime
   91 fail if:
   92 .Bl -tag -width Er
   93 .It Bq Er ZIP_ER_INVAL
   94 .Ar index
   95 is not a valid file index in
   96 .Ar archive .
   97 .It Bq Er ZIP_ER_MEMORY
   98 Required memory could not be allocated.
   99 .It Bq Er ZIP_ER_RDONLY
  100 The
  101 .Ar archive
  102 was opened in read-only mode.
  103 .El
  104 .Sh SEE ALSO
  105 .Xr libzip 3 ,
  106 .Xr zip_stat 3
  107 .Sh HISTORY
  108 .Fn zip_file_set_mtime
  109 was added in libzip 1.0.
  110 .Fn zip_file_set_dostime
  111 was added in libzip 1.6.
  112 .Sh AUTHORS
  113 .An -nosplit
  114 .An Dieter Baron Aq Mt dillo@nih.at
  115 and
  116 .An Thomas Klausner Aq Mt tk@giga.or.at
  117 .Sh CAVEATS
  118 Following historical practice, the
  119 .Fn zip_file_set_mtime
  120 function translates the time from the zip archive into the local time
  121 zone.
  122 If you want to avoid this, use the
  123 .Fn zip_file_set_dostime
  124 function instead.