Questions tagged [create-directory]
194 questions
142
votes
2 answers
How to create empty folder in java?
I tried to use the File class to create an empty file in a directory like "C:/Temp/Emptyfile".
However, when I do that, it shows me an error : "already made folder Temp". Otherwise, it won't create one for me.
So, how do I literally create folders…

user385261
- 4,069
- 8
- 26
- 24
59
votes
8 answers
46
votes
4 answers
Trying to use open(filename, 'w' ) gives IOError: [Errno 2] No such file or directory if directory doesn't exist
I am trying to create and write to a text file using Python. I have searched and cannot find a solution/reason for this error.
Here's the code that doesn't work:
afile = 'D:\\temp\\test.txt'
outFile = open(afile, 'w'…

gonzalimator
- 475
- 1
- 4
- 9
42
votes
15 answers
Create a folder and sub folder in Excel VBA
I have a pull down menu of companies that is populated by a list on another sheet. Three columns, Company, Job #, and Part Number.
When a job is created I need a folder for said company and a sub-folder for said Part Number.
If you go down the path…

Matt Ridge
- 3,633
- 16
- 45
- 63
17
votes
6 answers
Automatically create directories from long paths
I have a collection of files with fully qualified paths (root/test/thing1/thing2/file.txt). I want to foreach over this collection and drop the file into the location defined in the path, however, if certain directories don't exist, I want them to…

Brian David Berman
- 7,514
- 26
- 77
- 144
15
votes
3 answers
Is CreateDirectory() in C# thread-safe?
Can I safely attempt to create the same directory from two different threads, without having one of them throw an exception, or run into other issues?
Note that according to MSDN, it is OK to call CreateDirectory() on a directory which already…

bavaza
- 10,319
- 10
- 64
- 103
14
votes
3 answers
Check if folder is there, if not create it on current user logged in VBS
Currently this is my script
Set oWS = WScript.CreateObject("WScript.Shell")
' Get the %userprofile% in a variable, or else it won't be recognized
userProfile = oWS.ExpandEnvironmentStrings( "%userprofile%" )
What I am trying to do is grab the…

user2281912
- 153
- 1
- 1
- 6
12
votes
4 answers
Powershell To Create Folder If Not Exists
I am attempting to parse a file name in a folder and store parts of the filename in variables. Check! I then want to take one of the variables and check if that folder name exists in a different location, and if it does not create it. If I use…

BellHopByDayAmetuerCoderByNigh
- 1,107
- 4
- 21
- 41
11
votes
1 answer
Directory.CreateDirectory could not find a part of path c:\
Why does Directory.CreateDirectory throw a DirectoryNotFoundException when attempting to create the following path?
"c:\\temp\\aips\\data\\prn"
with message indicating it could not find a part of the path "c:\".
Yet, if passed the following path…

Klaus Nji
- 18,107
- 29
- 105
- 185
10
votes
2 answers
Android DownloadManager illegalstateexception unable to create directory
I'm making android app which is using DownloadManager.
I want to download file into folder which I made.
But this sources don't operate.
And happen IllegalstateException.
What can I do??
urlToDownload = Uri.parse(URL);
List pathSegments =…

user2486655
- 115
- 1
- 5
9
votes
3 answers
Trying to CreateDirectory, getting char* to LPCWSTR error, willing to try another function
I've tried Googling this, and there are so many answers based on various specific situations that frankly I'm more stuck than I was when I started.
The facts are these:
Language: C/C++
OS: Windows
IDE: Visual Studio 2005
I'm trying to create a…

Rae
- 309
- 3
- 9
9
votes
2 answers
add a directory when creating tar archive
I want to tar some files (and directories) but want to create an additional directory those files should reside in.
So for example for the following directory structure:
myproject
+ file1
+ file2
+ subdir1
+ file3
I cd into the myproject…

radlan
- 2,393
- 4
- 33
- 53
8
votes
3 answers
How do I create a folder using ExtendScript?
This seems like it would be a very easy problem to solve, but I've been banging my head against it for almost an hour. All I need is a snippet of javascript/extendscript code so that my InDesign CS6 script can create a folder. I know the existing…

Sturm
- 689
- 2
- 23
- 52
7
votes
1 answer
Android - Creating a folder in the data/data/pkg/files directory
Referencing this question:
How to create files hierarchy in Androids '/data/data/pkg/files' directory?
What kind of a solution is there to this problem using the built in standard Java libraries, how do I navigate to the data/data/pkg directory and…

Tim
- 8,932
- 4
- 43
- 64
7
votes
3 answers
How to create a folder in C (need to run on both Linux and Windows)
I don't have much experience and I'm on a C project where I need to create & delete folders and the program must run on both Linux and Windows.
I saw few solutions but all were either for Windows or Linux but none for both and most uses…

Aleksandair
- 167
- 1
- 2
- 11