日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

php文件夹0777,PHP代码mkdir(‘images’,’0777′)创建一个具有411权限的文件夹!为什么?...

發布時間:2023/12/1 php 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php文件夹0777,PHP代码mkdir(‘images’,’0777′)创建一个具有411权限的文件夹!为什么?... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我發誓這是昨天的工作.然而,現在下面的代碼破壞文件夾沒有問題,但創建一個具有411權限的新文件夾應該是777.我的代碼昨天這樣做.

這樣做的目的是壓縮文件夾,傳遞文件夾,刪除圖像,然后為圖像創建新目錄.

有人能告訴我我做錯了什么或我應該做什么?謝謝

function delete_directory($dirname) {

if (is_dir($dirname))

$dir_handle = opendir($dirname);

if (!$dir_handle)

return false;

while($file = readdir($dir_handle)) {

if ($file != "." && $file != "..") {

if (!is_dir($dirname."/".$file))

unlink($dirname."/".$file);

else

delete_directory($dirname.'/'.$file);

}

}

closedir($dir_handle);

rmdir($dirname);

return true;

}

$directoryToZip="jigsaw/"; // This will zip all the file(s) in this present working directory

$outputDir="/"; //Replace "/" with the name of the desired output directory.

$zipName="jigsaw.zip";

include_once("createzipfile/CreateZipFile.inc.php");

$createZipFile=new CreateZipFile;

/*

// Code to Zip a single file

$createZipFile->addDirectory($outputDir);

$fileContents=file_get_contents($fileToZip);

$createZipFile->addFile($fileContents, $outputDir.$fileToZip);

*/

//Code toZip a directory and all its files/subdirectories

$createZipFile->zipDirectory($directoryToZip,$outputDir);

/*

$rand=md5(microtime().rand(0,999999));

$zipName=$rand."_".$zipName;

*/

$fd=fopen($zipName, "wb");

$out=fwrite($fd,$createZipFile->getZippedfile());

fclose($fd);

$createZipFile->forceDownload($zipName);

@unlink($zipName);

delete_directory('jigsaw/assets/images/jigsaw_image');

mkdir('jigsaw/assets/images/jigsaw_image','0777');

總結

以上是生活随笔為你收集整理的php文件夹0777,PHP代码mkdir(‘images’,’0777′)创建一个具有411权限的文件夹!为什么?...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。