in Education by
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? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
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; }

Related questions

0 votes
    If I am trying to determine the read speed of a drive, I can code a routine to write files to a ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 20, 2022 in Education by JackTerrance
0 votes
    I have a web page that accepts an excel file, reads data from it and stores it in a buffer table ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 30, 2022 in Education by JackTerrance
0 votes
    How do I parse a string eg. "01/21 - 02/20" which is represented as month/day to month/day. ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 14, 2022 in Education by JackTerrance
0 votes
    I want put perfect percentage on each chart column as shown in fig in C# Windows Forms. How would ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 6, 2022 in Education by JackTerrance
0 votes
    I want to put a value from database because my dropdown already have a value the same as the text ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 30, 2022 in Education by JackTerrance
0 votes
    I want to convert an int to a byte[2] array using BCD. The int in question will come from ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 30, 2022 in Education by JackTerrance
0 votes
    I want put perfect percentage on each chart column as shown in fig in C# Windows Forms. How would ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 26, 2022 in Education by JackTerrance
0 votes
    I need to check if url exists and can be reached. In order to do it I send Get request and ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 23, 2022 in Education by JackTerrance
0 votes
    Me and my colleague have different versions of VisualStudio. He used interpolated string and I couldn't ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 19, 2022 in Education by JackTerrance
0 votes
    How do I parse a string eg. "01/21 - 02/20" which is represented as month/day to month/day. ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    I want create expression with reflection in c#. I am target script is: using (var service = new ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    Hi Folks i was googling one more hours.i did not find anything relevant, I have text File like ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I have this XML file and am able to read it, but it breaks and returns null once it gets to the ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 27, 2022 in Education by JackTerrance
0 votes
    In .NET 4 beta 2, there is the new Numerics namespace with struct BigInteger. The documentation states that it is an ... = BigInteger.One; BigInteger b = BigInteger.One; while (b...
asked May 24, 2022 in Education by JackTerrance
0 votes
    I built an OCR application which reads PDF files and OCR's them. I built it using Multi-threading ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
...