Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

zip_source_file(3) [debian man page]

ZIP_SOURCE_FILE(3)					     Library Functions Manual						ZIP_SOURCE_FILE(3)

NAME
zip_source_file - create data source from a file LIBRARY
libzip (-lzip) SYNOPSIS
struct zip_source * zip_source_file(struct zip *archive, const char *fname); "zip_uint64_t start" "zip_int64_t len" DESCRIPTION
The function zip_source_file creates a zip source from a file. zip_source_file opens fname and reads len bytes from offset start from it. If len is 0 or -1, the whole file (starting from start ) is used. The fie is opened and read when the data from the source is used, usually by zip_close. RETURN VALUES
Upon successful completion, the created source is returned. Otherwise, NULL is returned and the error code in archive is set to indicate the error. ERRORS
zip_source_file fails if: [ZIP_ER_INVAL] fname, start, or len are invalid. [ZIP_ER_MEMORY] Required memory could not be allocated. [ZIP_ER_OPEN] Opening fname failed. SEE ALSO
libzip(3), zip_add(3), zip_replace(3), zip_source_buffer(3), zip_source_filep(3), zip_source_free(3), zip_source_function(3), zip_source_zip(3) AUTHORS
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at> NiH August 1, 2008 ZIP_SOURCE_FILE(3)

Check Out this Related Man Page

ZIP_ADD(3)						     Library Functions Manual							ZIP_ADD(3)

NAME
zip_add , - .Nm zip_replace add file to zip archive or replace file in zip archive LIBRARY
libzip (-lzip) SYNOPSIS
#include <zip.h> zip_int64_t zip_add(struct zip *archive, const char *name); "struct zip_source *source" int zip_replace(struct zip *archive, zip_uint64_t index); "struct zip_source *source" DESCRIPTION
The function zip_add adds a file to a zip archive, while zip_replace replaces an existing file in a zip archive. The argument archive specifies the zip archive to which the file should be added. name is the file's name in the zip archive (for zip_add ), while index speci- fies which file should be replaced (for zip_replace ). The data is obtained from the source argument. See the zip_source_* functions cited in SEE ALSO. RETURN VALUES
Upon successful completion, zip_add returns the index of the new file in the archive, and zip_replace returns 0. Otherwise, -1 is returned and the error code in archive is set to indicate the error. EXAMPLES
struct zip_source *s; if ((s=zip_source_buffer(archive, buffer, len)) == NULL || zip_add(archive, name, s) 0) { zip_source_free(s); printf("error adding file: %s0, zip_strerror(archive)); } ERRORS
zip_add and zip_replace fail if: [ZIP_ER_EXISTS] There is already a file called name in the archive. (Only applies to zip_add ). [ZIP_ER_INVAL] source or name are NULL, or index is invalid. [ZIP_ER_MEMORY] Required memory could not be allocated. SEE ALSO
libzip(3), zip_source_file(3), zip_source_filep(3), zip_source_function(3), zip_source_zip(3) AUTHORS
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at> NiH March 10, 2009 ZIP_ADD(3)
Man Page

8 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. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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