Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

zip_name_locate(3) [debian man page]

ZIP_NAME_LOCATE(3)					     Library Functions Manual						ZIP_NAME_LOCATE(3)

NAME
zip_name_locate - get index of file by name LIBRARY
libzip (-lzip) SYNOPSIS
#include <zip.h> int zip_name_locate(struct zip *archive, const char *fname, int flags); DESCRIPTION
The zip_name_locate function returns the index of the file named fname in archive. If archive does not contain a file with that name, -1 is returned. The are specified by or'ing the following values, or 0 for none of them. ZIP_FL_NOCASE Ignore case distinctions. ZIP_FL_NODIR Ignore directory part of file name in archive. RETURN VALUES
zip_name_locate returns the index of the file named fname or -1, if archive does not contain an entry of that name. ERRORS
The zip_name_locate function fails and sets the error information to ZIP_ER_NOENT if no entry of the name fname is found in the archive. If one of the arguments is invalid, the error information is set to ZIP_ER_INVAL. SEE ALSO
libzip(3), zip_get_name(3) AUTHORS
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at> NiH October 4, 2006 ZIP_NAME_LOCATE(3)

Check Out this Related Man Page

ZIP_FOPEN(3)						     Library Functions Manual						      ZIP_FOPEN(3)

NAME
zip_fopen , - .Nm zip_fopen_index open file in zip archive for reading LIBRARY
libzip (-lzip) SYNOPSIS
#include <zip.h> struct zip_file * zip_fopen(struct zip *archive, const char *fname, int flags); struct zip_file * zip_fopen_index(struct zip *archive, zip_uint64_t index, int flags); DESCRIPTION
The zip_fopen function opens the file name fname in archive. The flags argument specifies how the name lookup should be done, according to the values are described in zip_name_locate(3). Also, the following values may be or'ed to it. ZIP_FL_COMPRESSED Read the compressed data. Otherwise the data is uncompressed by zip_fread. ZIP_FL_UNCHANGED Read the original data from the zip archive, ignoring any changes made to the file. The zip_fopen_index function opens the file at position index. If encrypted data is encountered, the functions call zip_fopen_encrypted(3) or zip_fopen_index_encrypted(3) respectively, using the default password set with zip_set_default_password(3). RETURN VALUES
Upon successful completion, a struct zip_file pointer is returned. Otherwise, NULL is returned and the error code in archive is set to indicate the error. ERRORS
[ZIP_ER_CHANGED] The file data has been changed. [ZIP_ER_COMPNOTSUPP] The compression method used is not supported. [ZIP_ER_ENCRNOTSUPP] The encryption method used is not supported. [ZIP_ER_MEMORY] Required memory could not be allocated. [ZIP_ER_READ] A file read error occurred. [ZIP_ER_SEEK] A file seek error occurred. [ZIP_ER_ZLIB] Initializing the zlib stream failed. The function zip_fopen may also fail and set for any of the errors specified for the routine zip_name_locate(3). The function zip_fopen_index may also fail with ZIP_ER_INVAL if index is invalid. SEE ALSO
libzip(3), zip_fclose(3), zip_fread(3), zip_get_num_entries(3), zip_name_locate(3), zip_set_default_password(3) AUTHORS
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at> NiH February 14, 2011 ZIP_FOPEN(3)
Man Page

11 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Urgent - help please

i have the below script grep `basename $fname | cut -c2-5` $STORE_LIST` >> all cat $fname >> all the output comes in two line..i want the same output above to come in single line ..can someone help (5 Replies)
Discussion started by: mkan
5 Replies

2. AIX

Substitution not working in ksh

Following code is working in bash but not in ksh. Can someone please send me an alternative? #!/bin/ksh fname="EOA.dmp" echo $fname logname=${fname/.dmp/.log} echo $logname I am getting below error in ksh "testcmd: logname=${fname/.dmp/.log}: 0403-011 The specified substitution is not... (2 Replies)
Discussion started by: arsheshadri
2 Replies

3. Solaris

Substitution not working in ksh

Hi, Following code is working in bash but not in ksh. Can someone please send me an alternative? #!/bin/ksh fname="EOA.dmp" echo $fname logname=${fname/.dmp/.log} echo $logname I am getting below error in ksh "testcmd: logname=${fname/.dmp/.log}: 0403-011 The specified substitution... (3 Replies)
Discussion started by: arsheshadri
3 Replies

4. Shell Programming and Scripting

hi friends....

hi friend i am facing problem in taking input from a file to the variable .. read fname if then cd $fname pwd ls > new_temp1 cat new_temp1 fi terminal=`tty` exec < $new_temp1 while read line do echo $line done exec < $terminal (2 Replies)
Discussion started by: newson
2 Replies

5. Shell Programming and Scripting

cp && rm command, rm: <file> not removed. No such file or directory

Hi, I am running this is korn shell cp $source/$fname $dest/dir && rm $source/$fname This was returned: rm: /dir/file not removed: No such file or directory The file could be found in the $dest directory which meant the cp was success. The above code is used in a for loop to move... (5 Replies)
Discussion started by: Leion
5 Replies

6. Programming

chmod:No such file or directory

sprintf(fname, "core.%d", pid); (void) unlink(fname); if (ttrace(TT_PROC_CORE, pid, 0, 0, 0, 0) != 0) { perror("TT_PROC_CORE pass"); Fail(); } if (chmod(fname, 0) != 0) { perror("chmod"); Fail(); } Hi, If i execute above code,everytime am getting below... (1 Reply)
Discussion started by: mansa
1 Replies

7. Shell Programming and Scripting

How to compare that file name is empty?

i am finding some pattern this way.. fname=`grep -w "^$index" $HOME/UnixCw/backup/Path.txt` how to check that fname is empty i.e. if pattren doesnt found then i want to do other operations.... (7 Replies)
Discussion started by: AbhijitIT
7 Replies

8. Shell Programming and Scripting

problem facing in if -else condition

can u plz tell me where is the error echo enter the filename to be searched read fname if #-d $fname then echo file exists if then echo itsa directory elif then echo its readable cat $fname else echo its not readable fi else ... (1 Reply)
Discussion started by: gotam
1 Replies

9. UNIX for Dummies Questions & Answers

Problems in shell script if sed is used

Hi All, Below is the script which i have written in cygwin: #!/usr/bin/sh fname=$1 cat $fname | sed 's/ //g' > fname1 for i in `cat $fname1` do echo $i > file1 #param1 is script name param1=`awk -F , '{print $1}' file1` param1="$param1.sql" #param2 is BL param2=`awk -F , '{print... (5 Replies)
Discussion started by: janardhanamk
5 Replies

10. Shell Programming and Scripting

extract characters from file name - script

trying to extract the numbers in this file name: fname="ebcdic.f0633.cmp_ebcdic.f0633.bin" fnametmp=${fname#*(V|v|F|f)} parse=${fnametmp%%(ENC|enc|CMP|cmp|BIN|bin)}} echo FLRECL=$parse result is FLRECL=0633.cmp_ebcdic.f0633 expected result FLRECL=0633 my guru is on holiday and i need... (5 Replies)
Discussion started by: mambo2523
5 Replies

11. UNIX for Advanced & Expert Users

why the script is not terminating with proper results

Hi everyone, I am new to the linux.I wrote a small script and assigning two values to fname and lname and I want if the fname or lname are not given proper name like Toys or Gun the script should terminate and if they are given proper name it should execute.please help thanks:wall: #!/bin/bash... (4 Replies)
Discussion started by: starter2011
4 Replies