10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have .zip file, i want to list all the files archived in the zip file. unzip utility is not working for me in unix.
Please help me resolve this issue
Thanks
ganesh. (3 Replies)
Discussion started by: Ganesh L
3 Replies
2. UNIX for Dummies Questions & Answers
I need to download team foundation server on Unix (4 simple instructions below), but I am stuck.. I am newbie Unix user, so please be patient.
-cd /home/Myname/Downloads, Unzip
-Unzipped to /home/Myname/DestFolder
-cd DestFolder, type tf -help, works there
- outside this folder, doesn't... (1 Reply)
Discussion started by: software2007
1 Replies
3. Shell Programming and Scripting
Hi,
I have the following subfolder with files:
/data/a/1/xxx.txt
/data/b/2/yyy.txt
/data/c/3/zzz.txt
And i have a set of new folders which have exactly the same structure as above but different disk without the files:
/data_02/a/1/
/data_02/b/2/
/data_02/c/3/
Now i would like to... (6 Replies)
Discussion started by: total_ysf
6 Replies
4. Shell Programming and Scripting
Hi,
I need to zip/compress a data file and send to a vendor. The vendor does have only unzip utility and can accept only .ZIP files. I do not have zip utility in my server.
How do I zip/compress the file so that it can be deflated using unzip command ? I tried gzip & compress commands, but... (1 Reply)
Discussion started by: Sabari Nath S
1 Replies
5. UNIX for Dummies Questions & Answers
Hi
is there a command to get the count of files inside each sub directory in a directory.
example:
in a directory like this
/opt/:> ls
subdir1
subdir2
subdir3
I need to see the count of files in sub directories like this:
/opt/subdir1: 3 files
/opt/subdir2: 5 files
/opt/subdir3: 10... (1 Reply)
Discussion started by: sanjangr
1 Replies
6. UNIX and Linux Applications
Hi,
I need to make a folder read only under a fileshare that has full permissions granted to it. The fileshare with full permissions is /u02/prodfileshare. The folder I need to make read only for everyone except the owner of the folder is called /u02/prodfileshare/EFT/purchases. ... (0 Replies)
Discussion started by: sparcman
0 Replies
7. Shell Programming and Scripting
Hi Everyone,
For exmaple, i have 5 .zip files.
So i can do "unzip -L -o file1.zip -d /home/user1" for every 5 files. But the problem is those 5 zip files, have same path and file name. So if i use "-o", all will be overwirte.
The output is unzip all files, but put all unzipped files... (1 Reply)
Discussion started by: jimmy_y
1 Replies
8. Shell Programming and Scripting
Hi All
I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX).
I don't have unzip cmd available in my curent Unix version
Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file .
Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies
9. Shell Programming and Scripting
I am listing the contents of a zip file and then grepping for a specific string ie: filename.a to get a line like: 309753 10-18-08 15:20 etc/filename.a
The etc/filename.a is the path the file is at within the zip file...how might I capture this path as I want to use that path to unzip that... (2 Replies)
Discussion started by: phreezr
2 Replies
10. HP-UX
Hi All
I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX).
I don't have unzip cmd available in my curent Unix version
Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file .
Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies
ZIPARCHIVE.ADDFILE(3) 1 ZIPARCHIVE.ADDFILE(3)
ZipArchive::addFile - Adds a file to a ZIP archive from the given path
SYNOPSIS
bool ZipArchive::addFile NULL (string $filename, [string $localname], [int $start], [int $length])
DESCRIPTION
Adds a file to a ZIP archive from a given path.
PARAMETERS
o $filename
- The path to the file to add.
o $localname
- If supplied, this is the local name inside the ZIP archive that will override the $filename.
o $start
- This parameter is not used but is required to extend ZipArchive.
o $length
- This parameter is not used but is required to extend ZipArchive.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
This example opens a ZIP file archive test.zip and add the file /path/to/index.txt. as newname.txt.
Example #1
Open and add
<?php
$zip = new ZipArchive;
if ($zip->open('test.zip') === TRUE) {
$zip->addFile('/path/to/index.txt', 'newname.txt');
$zip->close();
echo 'ok';
} else {
echo 'failed';
}
?>
NOTES
Note
When a file is set to be added to the archive, PHP will lock the file. The lock is only released once the ZipArchive object has
been closed, either via ZipArchive::close or the ZipArchive object being destroyed. This may prevent you from being able to delete
the file being added until after the lock has been released.
PHP Documentation Group ZIPARCHIVE.ADDFILE(3)