create-directory

How do I create a folder using ExtendScript?

拜拜、爱过 提交于 2019-12-05 02:01:45
问题 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 folder in which the new one should be created, and I know the name that this new folder should be called. But how do I get javascript to do it? By the way, all searches online for the folderObj.create() method, which is in the JavaScript Tools Guide,

How do I create a folder using ExtendScript?

亡梦爱人 提交于 2019-12-03 16:16:39
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 folder in which the new one should be created, and I know the name that this new folder should be called. But how do I get javascript to do it? By the way, all searches online for the folderObj.create() method, which is in the JavaScript Tools Guide, prove useless. I've tried several variations on that method, but nothing seems to actually create the

Is CreateDirectory() in C# thread-safe?

帅比萌擦擦* 提交于 2019-12-03 05:32:30
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 exists, in which case the method is expected to do nothing. The Directory.CreateDirectory call itself is safe to make from multiple threads. It will not corrupt program or file system state if you do so. However it's not possible to call Directory.CreateDirectory in such a way to guarantee it won't throw an exception. The file system is an unpredictable

Creating directories in medium trust environment?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 10:45:41
I've got an ASP.NET Web Application running in a medium trust environment with a shared hosting provider. The following code causes a SecurityException to be thrown: private void TestButton_Click(object sender, EventArgs e) { string directory = Server.MapPath("~/MyFolder/") + "_TestDirectory"; if (!Directory.Exists(directory)) Directory.CreateDirectory(directory); } The full text of the error is: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

Android - Creating a folder in the data/data/pkg/files directory

江枫思渺然 提交于 2019-11-30 09:25:47
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 create folders and files in there? Maybe using some of the Android calls where possible? When a user uses my app I wish to save any files associated with that user in a folder pkg/files/username, so that I can easily read these folders later. My other option is include the username in the filename but this isn't a very suitable and clean method in

Android DownloadManager illegalstateexception unable to create directory

一笑奈何 提交于 2019-11-30 08:22:26
问题 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<String> pathSegments = urlToDownload.getPathSegments(); request = new DownloadManager.Request(urlToDownload); request.setTitle(Titlename); request.setDescription("MCPE STORE"); request.setDestinationInExternalPublicDir( Environment.getExternalStorageDirectory()

Trying to use open(filename, 'w' ) gives IOError: [Errno 2] No such file or directory if directory doesn't exist

余生颓废 提交于 2019-11-30 06:39:13
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' ) outFile.write('Test.') outFile.close() # Error: 2 # Traceback (most recent call last): # File "<maya console>", line 1, in <module> # IOError: [Errno 2] No such file or directory: 'D:\\temp\\test.txt' # Most answers I found related to the slashes in the path, so... I tried 'D:/temp/test.txt' and got an error. I tried r'D:\temp\test.txt' and got an error. When I try to create a

Android DownloadManager illegalstateexception unable to create directory

烂漫一生 提交于 2019-11-29 06:56:21
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<String> pathSegments = urlToDownload.getPathSegments(); request = new DownloadManager.Request(urlToDownload); request.setTitle(Titlename); request.setDescription("MCPE STORE"); request.setDestinationInExternalPublicDir( Environment.getExternalStorageDirectory().getAbsolutePath() + "/MCPE STORE", pathSegments.get(pathSegments.size()-1)); Environment

Trying to use open(filename, 'w' ) gives IOError: [Errno 2] No such file or directory if directory doesn't exist

微笑、不失礼 提交于 2019-11-29 05:31:50
问题 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' ) outFile.write('Test.') outFile.close() # Error: 2 # Traceback (most recent call last): # File "<maya console>", line 1, in <module> # IOError: [Errno 2] No such file or directory: 'D:\\temp\\test.txt' # Most answers I found related to the slashes in the path, so... I tried 'D:

How to create empty folder in java? [duplicate]

99封情书 提交于 2019-11-28 16:01:42
Possible Duplicate: How to create a folder? 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 with java API? sarnold Looks file you use the .mkdirs() method on a File object: http://www.roseindia.net/java/beginners/java-create-directory.shtml // Create a directory; all non-existent ancestor directories are // automatically created success = (new File("../potentially/long/pathname/without/all/dirs"))