10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a simple function that greps within a folder into files that are already gunzipped. This was already written for me so from my understanding fn=$1 specifies that it will look into any file in that folder that is gunzipped and the rest of the script greps the data its looking for and puts it... (3 Replies)
Discussion started by: red56
3 Replies
2. UNIX for Dummies Questions & Answers
I have an amount of folders and I want to delete only the empty ones. But I have more than 200 empty folders, so I would preffer do not delete one by one... I know it is possible, but I don't know how. I've tried with the size, using 'du' command, and saving the result in a file. After that, I made... (3 Replies)
Discussion started by: saitsug
3 Replies
3. Shell Programming and Scripting
Hi,
How do I write a script that will automatically find and zip any folder to the same name in a directory and affected recursively?. The zip file should be place in the same directory where the source folder is. Help is appreciated. Thanks in advance.
ex:
Orange Crayon
Blue Crayon... (5 Replies)
Discussion started by: Frozen77
5 Replies
4. Windows & DOS: Issues & Discussions
Hi all,
i am currently setting my windows XP environment to use with Services for Unix (NFS Client) to mount my unix file system as a network drive. However, though i could mount the unix file directory successful, but the folder is empty (which is not). Why is this so? i have imported my unix... (6 Replies)
Discussion started by: lchunleo
6 Replies
5. Shell Programming and Scripting
HI All
I have one master folder : ABCXYZ
I have sub folder in there :
AB
XY
AZ
AC
PR
AL
Now i want to copy AB , PR ,AL in to one new folder and zip it with time stamp.
like
Pre_02192013_12_32.zip
Zip folder should be in master folder. (2 Replies)
Discussion started by: pareshkp
2 Replies
6. Shell Programming and Scripting
Hey, I need help with writing a shell script that deletes empty folders..anyone? :)
Thank you! (5 Replies)
Discussion started by: putukas
5 Replies
7. UNIX for Dummies Questions & Answers
Hello,
I have a folder that contains all my music. Recently, I started using a different media player, and I let it manage my music folder. It has sorted all my music neatly in folders by artist and album. However, all the old folders that the songs used to be in are still there, yet they are... (2 Replies)
Discussion started by: emveedee
2 Replies
8. Shell Programming and Scripting
In current folder, there are many subfolders, subfolder's subfolders... under it.
How can I find out the empty folders with no files in it.
I only need the top folder list.
For example,
I have folders like below:
a/b/c
a/b/x/x.txt
a/s
a/s/y
I need get the folder a/s, but not... (6 Replies)
Discussion started by: rdcwayx
6 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I have a folder that contains a few sub-folders. I would like to zip that folder and KEEP the subfolders. What it does at the moment is taking all the files within the subfolders and zipping them into one big file (zip -r ...). Does anyone know the UNIX command to keep the subfolders in the... (3 Replies)
Discussion started by: gdog
3 Replies
10. UNIX for Dummies Questions & Answers
hi all:
my solaris FIND does not support
find myFolder -type d -empty
how can i find the empty folders?
thanks! (7 Replies)
Discussion started by: lasse
7 Replies
ZIPARCHIVE.OPEN(3) 1 ZIPARCHIVE.OPEN(3)
ZipArchive::open - Open a ZIP file archive
SYNOPSIS
mixed ZipArchive::open (string $filename, [int $flags])
DESCRIPTION
Opens a new zip archive for reading, writing or modifying.
PARAMETERS
o $filename
- The file name of the ZIP archive to open.
o $flags
- The mode to use to open the archive.
o ZipArchive::OVERWRITE
o ZipArchive::CREATE
o ZipArchive::EXCL
o ZipArchive::CHECKCONS
RETURN VALUES
o $Error codes
- Returns TRUE on success or the error code.
o ZipArchive::ER_EXISTS File already exists.
o ZipArchive::ER_INCONS Zip archive inconsistent.
o ZipArchive::ER_INVAL Invalid argument.
o ZipArchive::ER_MEMORY Malloc failure.
o ZipArchive::ER_NOENT No such file.
o ZipArchive::ER_NOZIP Not a zip archive.
o ZipArchive::ER_OPEN Can't open file.
o ZipArchive::ER_READ Read error.
o ZipArchive::ER_SEEK Seek error.
EXAMPLES
Example #1
Open and extract
<?php
$zip = new ZipArchive;
$res = $zip->open('test.zip');
if ($res === TRUE) {
echo 'ok';
$zip->extractTo('test');
$zip->close();
} else {
echo 'failed, code:' . $res;
}
?>
Example #2
Create an archive
<?php
$zip = new ZipArchive;
$res = $zip->open('test.zip', ZipArchive::CREATE);
if ($res === TRUE) {
$zip->addFromString('test.txt', 'file content goes here');
$zip->addFile('data.txt', 'entryname.txt');
$zip->close();
echo 'ok';
} else {
echo 'failed';
}
?>
PHP Documentation Group ZIPARCHIVE.OPEN(3)