temporary-directory

Creating a temporary directory in Windows?

笑着哭i 提交于 2019-11-26 19:44:13
What's the best way to get a temp directory name in Windows? I see that I can use GetTempPath and GetTempFileName to create a temporary file, but is there any equivalent to the Linux / BSD mkdtemp function for creating a temporary directory? Scott Dorman No, there is no equivalent to mkdtemp. The best option is to use a combination of GetTempPath and GetRandomFileName . You would need code similar to this: public string GetTemporaryDirectory() { string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); Directory.CreateDirectory(tempDirectory); return tempDirectory; } I

iOS temporary folder location

谁都会走 提交于 2019-11-26 17:49:41
My app has just been rejected by Apple because it was storing temporary or cache files in the documents directory. Right. Their rejection message states: Temporary files used by your app should only be stored in the /tmp directory I suppose it is that besides the Documents and Library in the Application's folder. I am now trying to debug this issue in the iPhone Simulator, and when I use NSTemporaryDirectory() , the value I get in the Xcode debugger is /var/folders/yj/gnz1c7156c7d6d4fj429yms40000gn/T/tempzip.zip , and not /Users/me/Library/Application Support/iPhone Simulator/5.1/Applications

How to get temporary folder for current user

こ雲淡風輕ζ 提交于 2019-11-26 12:03:57
Currently I am using following function to get the temporary folder path for current user: string tempPath = System.IO.Path.GetTempPath(); On some machines it gives me temp folder path of current user like: C:\Documents and Settings\administrator\Local Settings\Temp\ On some machines it gives me system temp folder path like: C:\Windows\TEMP MSDN Documentation also says that above API returns current system's temporary folder. Is there any other API available which gives me current user's temporary folder path like this: C:\Documents and Settings\administrator\Local Settings\Temp\ System.IO

Creating a temporary directory in Windows?

旧巷老猫 提交于 2019-11-26 06:29:42
问题 What\'s the best way to get a temp directory name in Windows? I see that I can use GetTempPath and GetTempFileName to create a temporary file, but is there any equivalent to the Linux / BSD mkdtemp function for creating a temporary directory? 回答1: No, there is no equivalent to mkdtemp. The best option is to use a combination of GetTempPath and GetRandomFileName. You would need code similar to this: public string GetTemporaryDirectory() { string tempDirectory = Path.Combine(Path.GetTempPath(),

iOS temporary folder location

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 05:34:39
问题 My app has just been rejected by Apple because it was storing temporary or cache files in the documents directory. Right. Their rejection message states: Temporary files used by your app should only be stored in the /tmp directory I suppose it is that besides the Documents and Library in the Application\'s folder. I am now trying to debug this issue in the iPhone Simulator, and when I use NSTemporaryDirectory() , the value I get in the Xcode debugger is /var/folders/yj

How to get temporary folder for current user

六眼飞鱼酱① 提交于 2019-11-26 02:28:15
问题 Currently I am using following function to get the temporary folder path for current user: string tempPath = System.IO.Path.GetTempPath(); On some machines it gives me temp folder path of current user like: C:\\Documents and Settings\\administrator\\Local Settings\\Temp\\ On some machines it gives me system temp folder path like: C:\\Windows\\TEMP MSDN Documentation also says that above API returns current system\'s temporary folder. Is there any other API available which gives me current

How to create a temporary directory/folder in Java?

风流意气都作罢 提交于 2019-11-26 00:41:53
问题 Is there a standard and reliable way of creating a temporary directory inside a Java application? There\'s an entry in Java\'s issue database, which has a bit of code in the comments, but I wonder if there is a standard solution to be found in one of the usual libraries (Apache Commons etc.) ? 回答1: If you are using JDK 7 use the new Files.createTempDirectory class to create the temporary directory. Path tempDirWithPrefix = Files.createTempDirectory(prefix); Before JDK 7 this should do it: