mkdir

Is there a way to make mv create the directory to be moved to if it doesn't exist?

So, if I'm in my home directory and I want to move foo.c to ~/bar/baz/foo.c , but those directories don't exist, is there some way to have those directories automatically created, so that you would only have to type mv foo.c ~/bar/baz/ and everything would work out? It seems like you could alias mv to a simple bash script that would c...

SVN: How to re-create a directory that's created but not committed yet

Here's a little SVN problem: I create a directory locally: $ svn mkdir output A output I accidentally remove it: rm -rf output Now, how do I recreate it? I tried this: $ svn mkdir output svn: 'output' is already under version control And this: $ svn revert output Reverted 'output' But it's still not there. UPDATE: P...

mkdir -p functionality in python

Is there a way to get functionality similar to mkdir -p on the shell... from within python. I am looking for a solution other than a system call. I am sure the code is less than 20 lines... really I am wondering if someone has already written it? ...

MKDIR is not working correctly?

Hi, i'm using Xampp. When I tried to do this earlier, it worked, but now it is not working. I'm trying to make a directory in my www folder to hide it from baddies who steal files. Each user gets their own folder in uploads to put their files on. Xampp uses apache, and Xampp is a local web server. It allows me to design websites witho...

How to mkdir only if a dir does not already exist?

I am writing a script to run under the korn shell on AIX. I'd like to use the mkdir command to create a directory. But the directory may already exist, in which case I don't want to do anything. So I want to either test to see that the directory doesn't exist, or suppress the "File exists" error that mkdir throws when it tries to create ...

mkdir -p Linux..Windows..?

hi all, thanks to all for ur valuable replies.. Also, in linux mkdir -p creates a folder tree.. What is the equivalent option in Windows( to create a folder tree) ? Is there any? Renjith G ...

How to find a reason when mkdir fails from PHP?

PHP's mkdir function only returns true and false. Problem is when it returns false. If I'm running with error reporting enabled, I see the error message on the screen. I can also see the error message in the Apache log. But I'd like to grab the text of the message and do something else with it (ex. send to myself via IM). How do I get t...

How do I create a directory and parent directories in one Perl command?

In Perl, how can I create a subdirectory and, at the same time, create parent directories if they do not exist? Like UNIX's mkdir -p command? ...

How to create new folder?

I want to put output information of my program to a folder. if given folder is not exit, then program should create a new folder with folder name as given in the program. is it possible? if yes please let me how. suppose i have given folder path like "C:\Program Files\alex" and alex folder doesn't exist then program should create alex fo...

writing files and dirs using C++

I'm working on a program that creates 2000 directories and puts a file in each (just a 10KB or so file). I am using mkdir to make the dirs and ofstream (i tried fopen as well) to write the files to a solid state drive (i'm doing speed tests for comparison). When I run the code the directories are created fine but the files stop writing ...

Can't create a folder with mkdir

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 w...

PHP mkdir( $recursive = true ) skips last directory

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 axcept for the last one... when I add another directory like: '/path/to/create/recur/ively/more/' again, all paths are created except ...

How do I use filesystem functions in PHP, using UTF-8 strings?

I can't use mkdir to create folders with UTF-8 characters. <?php $dir_name = "Depósito"; mkdir($dir_name ); ?> But, when I browse this folder in Windows Explorer, the folder name looks like this: Depósito What should I do? ...

mkdir nant permissions

I need to use mkdir on a network path, which is on a different domain. I can login into the network properly, however nant is not able to. I setup a network drive on the system where nant runs, however it still cant access it. Does anybody know how to achieve this? ...

Python mkdir giving me wrong permissions

Hello all again :D I'm (trying) to create a folder and create a file within it. Whenever i create that folder (via Python), it creates a folder that gives me no permissions at all and read-only mode. When i try to create the file i get an IOError. Erro: <type 'exceptions.IOError'> I tried creating (and searching) for a description...

How do I include parameters in a bash alias?

Trying to create: alias mcd="mkdir $1; cd $1" Getting: $ mcd foo usage: mkdir [-pv] [-m mode] directory ... -bash: foo: command not found What am I doing wrong? ...

Recursive mkdir() and chmod()?

When using mkdir() with the recursive flag set to true do all the created directories get the specified chmod or just the last one? For example: mkdir('/doesnotExist1/doesnotExist2/doesnotExist3/', 0755, true); Will the newly created directories /doesnotExist1/ and /doesnotExist1/doesnotExist2/ also get the same chmod as /doesnotExist...

Solutions for the potential lack of permission to mkdir() from within a php install script.

Alright, so I have a problem. I need to create a folder to store compiled templates in php. I have an install script that tries to mkdir() an appropriate directory (compiled_templates). Invariably it returns this warning. Warning: mkdir() [function.mkdir]: Permission denied in /home/tchalvak/sites/quotesite/quotes/install.php on line...

mkdir not working in PHP

Have been pulling out my hair for the past 2 hours on this and am sure I am doing something really stupid. <?php mkdir("blah", 0777); ?> This works through the command line and the folder gets created. But the same thing doesn't work when I try to run it through the browser. Any file permission issues? ...

Create directory in Vim

I can not create a directory in russian (UTF-8) using vimscript in WinXP. For example :call mkdir("привет") creates directory with привет name instead of привет. I have also tried :call system("mkdir привет") with the same result. Is it possible? ...