mkdir

Recursive mkdir() system call on Unix

After reading the mkdir(2) man page for the Unix system call with that name, it appears that the call doesn't create intermediate directories in a path, only the last directory in the path. Is there any way (or other function) to create all the directories in the path without resorting to manually parsing my directory string and individu...

Is 0 necessary in 0777 here in PHP?

mkdir("/path/to/my/dir", 0700); Thanks ...

How do I setup a monit script to check if a directory exists and create it if it doesn't

In the monit documentation I can see there is a check directory command but I can't see any examples of how to use it to see if the directory exists and if it doesn't to create the directory using the mkdir command. ...

PHP mkdir and apache ownership

Is there a way to set php running under apache to create folders with the folder owned by the owner of the program that creates it instead of being owned by apache? Using word press it creates new folders to upload into but these are owned by apache.apache and not by the site that they are running in. This also happens using ostickets. ...

Batch scripting for directories or better method

Hi Everyone, Looking at creating a simple batch file for my app. My app needs some directories to be in place as it runs. The first method I thought was just make a batch script: @ECHO OFF IF NOT EXIST C:\App GOTO :CREATE ELSE GOTO :DONTCREATE :CREATE MKDIR C:\App\Code ECHO DIRECTORY CREATED :DONTCREATE ECHO IT WAS ALREADY THERE 1...

Php mkdir( ) exception handling

mkdir() is working correctly this question is more about catching an error. Instead of printing this when the directory exists I would just like to have it write to a message to me in a custom log. How do I create this exception. Warning: mkdir() [function.mkdir]: File exists ...

mkdir error in bash script

Hi, 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 /cygd...

Creating new folders if they don't exist for fopen

I have a C++ program that takes user input for fopen in order to initiate a file write. Could someone help me find a function which will return a FILE* and use the Windows specific version of mkdir in order to create the folder structure for fopen to never fail to open a new file in the specified location because one of the folders does ...

PHP mkdir issue!

Hi, I trying to create some dirs like this: @mkdir("photos/$cat/$sku", 0777, true) it creates the first directory with 0777 permissions, but when it creates the second is uses 000 as it's perms, so it fails to create the third. A workaround this please? Thanks, Richard. ...

how to find the directory already is there or not in php

hi i want know find the directory is already there or not... if not i would like to create the directory... my coding is below... $da = getdate(); $dat = $da["year"]."-".$da["mon"]."-".$da["mday"]; $m = md5($url)."xml"; if(is_dir($dat)) { chdir($dat); $fh = fopen($m, 'w'); fwrite($fh, $xml); fclose($fh); ech...

php mkdir windows relative path

Hi, Want to create a directory on windows from a PHP script. My script is in www/Test directory of Apache and want to create a folder(fold1) inside www/downloads directory. Inside the script, using, $dirName = "../downloads/fold1"; mkdir("{$dirName}"); If we use the full path of dirName like C:\Apache\www\downloads\fold1, it works f...

mkdir Function Error

Hi everyone, I am stuck on a simple script. I have tried Googling it and I have tried all of the stuff I found on Google but none of it has worked for me. I am trying to you the mkdir function but I keep getting an error that says: Warning: mkdir() [function.mkdir]: No such file or directory in /home/content/l/i/n/web/html/php/mkdir.php ...

mkdir() not working

My code mkdir("/some/absolute/path",0777); and mkdir("relative/path", 0777); is not working, safe mode is turned off, and I've even tried setting all of the parent folders to 777. Any ideas? EDIT: I do have error reporting turned on, in my frustration I've 777'd the whole path just to make sure that, that isn't the issue. It's got...

php chmod mkdir

I want to know what is the safiest chmode for creating user folders and user files. I create a user folder for each registration (in mode 700) and users can upload images into their folder. I read the php documentation but I'm still confuse about terms "owner", "group", "public"? Can I have a full explanation about it? (I can't found a g...

Creating/making directories in python (complex)

I am trying to create a bunch of directories/subdirectories that I can copy files into. I am working with Python and I can't seem to find a good way to do this. I have a main path that I will branch off of. Then after that, I have Weights and No_Weights. Male and Female following. Within each of Male and Female folders, I have each e...

Create folders recursively in Delphi

Need some help in creating function which can create folders recursively with giving path: C:\TestFolder\Another\AndAnother Delphi function MkDir returning IOerror = 3. MkDir('C:\TestFolder\Another\AndAnother'); Thanks in advance ...

FWRITE() Saving file to a specific location

This code below is using the FWRITE function. however i wish to save the file to a specific location but always get 'cant open file' as expected. i have setup the directory listed in mypath but it still wont write to that location. $mypath = "http://www.mysite.com/test/data/"; $myFile = $mypath."data.txt"; $fh = fopen($myFile...

My file isn't being moved to the specified and newly created folder using mkdir

So I'm having an issue. When someone signs up for an account on the site I'm building, they go to a setup page where they can upload a profile picture. I'm using mkdir to auto create a sub-folder with their username which is working fine, and CHMOD is 777 on that sub folder. The problem I'm having is that image is not being moved to that...

PHP: mkdir on buttonclick?

hi guys, i sort of want to create a little backend of a small website. i wonder how i make a button that creates a folder on my server? mkdir should work! however how can i trigger the mkdir event on a buttonclick? ...

Bash script to mkdir

I am trying to create a directory based on a variable entered by a user and then save files there. I thought this would be simple enough for me but I get an error message "No such file or directory" when I try to save there. When I hit "ls" it lists the directory with a "?" after it. I am working with an .sh script on a Mac terminal....