mkdir

Why mkdir fails with recursive option set true?

断了今生、忘了曾经 提交于 2019-12-05 03:07:55
I run the following code: mkdir('mnt/1',0777,true); mkdir('mnt/a',0777); Directory "a" is created, while directory "1" is not, page prints warning. Warning: mkdir(): File exists in /home/bitrix/www/php_test.php on line 3 I have full permissions on directory mnt for user apache is running: drwxr-xr-x 1 bitrix bitrix 4096 Nov 28 10:10 mnt PHP version - PHP 5.3.3. Apache version 2.2.15. Any ideas, why mkdir fails with recursive option set to true? Update! Well I cleared the folder, made the following php-script and ran it again: <?php error_reporting(E_ALL); mkdir('mnt/1',0777,true); mkdir('mnt/2

php: create directory on form submit?

安稳与你 提交于 2019-12-05 02:25:56
问题 I am wondering what I am doing wrong. I'm inside of PATH and I want to create a folder inside of PATH. I want to check if the folder already exists and, if not, create one. Getting the name of the folder from an input field with name of "dirname". if (isset($_POST['createDir'])) { //get value of inputfield $dir = $_POST['dirname']; //set the target path ?? $targetfilename = PATH . '/' . $dir; if (!file_exists($dir)) { mkdir($dir); //create the directory chmod($targetfilename, 0777); //make it

Create a folder and write into it in the root of android

五迷三道 提交于 2019-12-05 02:20:30
问题 I'm not trying to write into the external sd at /mnt/sdcard. I'm trying to create a folder for may app files and have them accesible by others. I have an app called Libra that generates .csv files when exporting data and all af it goes to /Libra/ folder. I want my app to do the same. As far as I've seen there's external storage which is the sd and internal which is a non public place for the app. How can I make a dir at the root of the android file system as Libra does ? If I ask for the

QDir mkdir with absolutepath

穿精又带淫゛_ 提交于 2019-12-05 00:48:14
I have problem with the creation of dir with Qt. I would like to create a dir in documents'dir so, I make some things like that : QString path("C:/Users/Me/Documents/MyApp/profiles/"); Qdir dir = QDir::root(); dir.mkdir(path); But that doesn't work! I have test with "/" and "\" for the separators but in the two cases that not work. How I can create my dir? Thank you. Try to use QDir::mkpath as dir.mkpath(path); You can do this: QDir dir(path); if (!dir.exists()){ dir.mkdir("."); } QDir dir = QDir::root() creates an instance of QDir configured to point to root and copies that setting to dir .

Can't create a folder with mkdir

做~自己de王妃 提交于 2019-12-04 20:15:43
Environment info: *Windows Vista *PHP 5.2.9-2 I'm working on a project. Let's say it's name simply "project". My php files meant for user-interaction will be found at project/file.php Now, I have a database behind this and some maps, which contain classes and configuration files in general. There is also a map for the users, in which I store images they might upload. For instance: project/files/Users/0/profilePic.jpg The number corresponds with the user_id in the database. My register.php file contains this line of code: mkdir('/files/Users/'.$id) The $id variable is the biggest id number in

mkdir error in bash script

元气小坏坏 提交于 2019-12-04 16:47:09
问题 The following is a fragment of a bash script that I'm running under cygwin on Windows: deployDir=/cygdrive/c/Temp/deploy timestamp=`date +%Y-%m-%d_%H:%M:%S` deployDir=${deployDir}/$timestamp if [ ! -d "$deployDir" ]; then echo "making dir $deployDir" mkdir -p $deployDir fi This produces output such as: making dir /cygdrive/c/Temp/deploy/2010-04-30_11:47:58 mkdir: missing operand Try `mkdir --help' for more information. However, if I type /cygdrive/c/Temp/deploy/2010-04-30_11:47:58 on the

How to create nested directories using Mkdir in Golang?

谁说我不能喝 提交于 2019-12-04 07:49:00
问题 I am trying to create a set of nested directories from a Go executable such as 'dir1/dir2/dir3'. I have succeeded in creating a single directory with this line: os.Mkdir("." + string(filepath.Separator) + c.Args().First(),0777); However, I have no idea how to approach creating a predetermined nested set of directories inside of that directory. 回答1: os.Mkdir is used to create a single directory. To create a folder path, instead try using: os.MkdirAll(folderPath, os.ModePerm) Go documentation

How to create a directory and give permission in single command

泄露秘密 提交于 2019-12-04 07:29:32
问题 How to create a directory and give permission in single command in Linux? I have to create lots of folder with full permission 777 . Commands mkdir path/foldername chmod 777 path/foldername I don't like to create and give permission in two commands. Can I do this in single command? 回答1: According to mkdir's man page... mkdir -m 777 dirname 回答2: install -d -m 0777 /your/dir should give you what you want. Be aware that every user has the right to write add and delete files in that directory.

How to make directory within directory by php loop?

随声附和 提交于 2019-12-04 07:11:55
问题 How to make directory within directory by php loop? Example: http://site_name/a/b/c/d First create a then b within a then c within b then .... Problem is here a,b,c,d all the folders created in root directory not one within one. Here is my code - <?php $url = "http://site_name/a/b/c/d"; $details1 = parse_url(dirname($url)); $base_url = $details1['scheme'] . "//" . $details1['host'] . "/"; if ($details1['host'] == 'localhost') { $path_init = 2; }else { $path_init = 1; } $paths = explode("/",

PHP mkdir( $recursive = true ) skips last directory

拜拜、爱过 提交于 2019-12-04 02:09:31
I've got the following piece of code on a PHP 5.2.4 (no safe_mode) linux server: mkdir( $path, 0777, true ); when I enter a path like: '/path/to/create/recur/ively/' all directories are created except for the last one... when I add another directory like: '/path/to/create/recur/ively/more/' again, all paths are created except for the last one... have tried both with and without trailing slashes Can any1 enlighten me here please? Ok the solutions is as follows: there was no problem. I did not test the code in isolation, but only assumed the following code was not doing anything to the directory