mkdir

Creating nested directories on server using JSch in Java

对着背影说爱祢 提交于 2019-12-04 01:49:08
问题 I am making an application for file uploading in Java using jSch . I want to put my file in different directories based on their creation date etc. I have a main directory "/var/local/recordingsbackup/" in which I am creating other directories and putting data in them. To achieve this: I have to create Dir'y like "/var/local/recordingsbackup/20140207/root/SUCCESS/WN/" and put data in it. I've tried this so far: private void fileTransfer(ChannelSftp channelTarget, temp_recording_log recObj,

mkdir() says theres no such directory and fails?

坚强是说给别人听的谎言 提交于 2019-12-03 18:00:10
问题 Im likely doing something very simply wrong, but when I try to make a directory (using a variable of an insert just performed as the last folder name), I get the error: Warning: mkdir() [function.mkdir]: No such file or directory in /home/blah/blah with the code: if (!is_dir("images/listing-images/rent/'.$insertID.")) { //make new directory with unique id mkdir("images/listing-images/rent/'.$insertID."); } of course the directory doesn't exist.. I'm trying to make it now? confused! 回答1: You

php: create directory on form submit?

社会主义新天地 提交于 2019-12-03 17:02:29
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 writable } } thecodeassassin It might be a good idea to make sure that the directory you are handling

mkdir() not working

心已入冬 提交于 2019-12-03 12:35:18
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 gotta be something stupidly simple going on. EDIT EDIT: Upvotes for everyone who responded with suggestions... But I'm not going to select an answer since this still isn't resolved, but then again I think this is going to be one of those ones left open forever. EDIT x 3:

How to use mkdirs in a thread safe manner in Java?

家住魔仙堡 提交于 2019-12-03 12:33:13
After experiencing issues with mkdirs() and poking around the interwebs, I get the impression that there are thread safety issues with mkdirs(). Is there a way to ensure the directories are properly created when it is possible that multiple threads might be trying to create similar file structures? Thanks (In my case I will be using this on Android) Okay, I know this has been inactive for a while, but I thought perhaps there was a simple solution. The article you linked in the comments on the question seems to indicate that the only problem is directories not being created. The solution there

mkdir error in bash script

旧街凉风 提交于 2019-12-03 10:35:44
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 command-line it succeeds, why does the same command not work in the script? Thanks, Don Change: mkdir -p

What is the difference between MD and MKDIR batch command?

强颜欢笑 提交于 2019-12-03 07:28:25
问题 Both command creates folders. I read that MKDIR can create even subfolders. Is that only difference? Why there are two commands doing the same? Which one should I use? 回答1: Just aliases of the same command.Here are the help messages: C:\>md /? Creates a directory. MKDIR [drive:]path MD [drive:]path and C:\>mkdir /? Creates a directory. MKDIR [drive:]path MD [drive:]path If Command Extensions are enabled MKDIR changes as follows: MKDIR creates any intermediate directories in the path, if

Does Ruby have mkdir -p? [duplicate]

本小妞迷上赌 提交于 2019-12-03 03:27:45
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to create directories recursively in ruby? In Ruby, how could I do: mkdir -p cool/beans Here's what I came up with: Dir.mkdir('cool') unless File.directory?('cool') cool_beans_path = File.join('cool', 'beans') Dir.mkdir(cool_beans_path) unless File.directory?(cool_beans_path) But, isn't there a better way? I know I could do: system('mkdir', '-p', File.join('cool', 'beans')) But, that's not platform

What is the difference between MD and MKDIR batch command?

谁都会走 提交于 2019-12-02 21:02:13
Both command creates folders. I read that MKDIR can create even subfolders. Is that only difference? Why there are two commands doing the same? Which one should I use? Just aliases of the same command.Here are the help messages: C:\>md /? Creates a directory. MKDIR [drive:]path MD [drive:]path and C:\>mkdir /? Creates a directory. MKDIR [drive:]path MD [drive:]path If Command Extensions are enabled MKDIR changes as follows: MKDIR creates any intermediate directories in the path, if needed. For example, assume \a does not exist then: mkdir \a\b\c\d is the same as: mkdir \a chdir \a mkdir b

Why does PHP think this folder doesn't exist?

你。 提交于 2019-12-02 20:04:48
问题 I'm having trouble creating a folder and writing into it. if(file_exists("helloFolder") || is_dir("helloFolder")){ echo "folder already exists"; } else { echo "no folder, creating"; mkdir("helloFolder", 0755); } This returns "no folder, creating" even when the folder already exists. Then I get this error: Warning: mkdir() [function.mkdir]: No such file or directory in script.php on line 18 Warning: file_put_contents(/filename.txt) [function.file-put-contents]: failed to open stream: