temporary-files

C/C++ Thread-safety of tmpnam?

I need to use the tmpnam function in C++, but I need to know about its thread safety. Namely, If I have several threads which will each need to acquire a different name for a temporary file, am I guaranteed that each thread will receive a file with a different name? ...

Temproray Asp.net files error

Hi when building my application I am getting some temporary files shown in Solution Explorer under Miscellaneous Files lie App_Web_YDKG.VB with following code block in that generating error Protected ReadOnly Property Profile() As System.Web.Profile.DefaultProfile Get Return CType(Me.Context.Profile,System.Web.Profile.Defaul...

How to get the ASP.NET temporary directory programmatically?

The temporary directory that's used by ASP.NET is usually located under C:\Windows\Microsoft.NET\Framework\<version>\Temporary ASP.NET Files\ Sometimes however it is overridden by the tempDirectory attribute on the compilation element in the web.config file. How can I get the temporary directory currently used by ASP.NET regardless if...

Python - tempfile.TemporaryFile cannot be read; why?

The official documentation for TemporaryFile reads: The mode parameter defaults to 'w+b' so that the file created can be read and written without being closed. Yet, the below code does not work as expected: import tempfile def play_with_fd(): with tempfile.TemporaryFile() as f: f.write('test data\n') f.wri...

Best way to work with temp images in Django?

I'm developing a Django project where I need to serve temporary images, which are generated online. The sessions should be anonymous; anyone should be able to use the service. The images should be destroyed when the session expires or closes. I don't know, however, what's the best approach. For instance, I could use file-based sessions ...

Cannot open database 'filename'. It may not be a database....Access 2007

Our program has an option for users to export data into an access database. The user then downloads the database and uses this for reporting, so on and so forth. Recently, we upgraded to Office 2007, and in testing, when downloading this database, we get the error message: "Cannot open database "filename" It may not be a database ...

Managing temporary files in a small .NET program

My question is about handling temporary files in a small .NET program. This program/utility just does the following with two URLs: Download each URL to a string (WebClient.DownloadString). Save each string to a temporary file. Call WinMerge (Process.Start) to diff the two files (in read-only mode for both files). I currently have the ...

Creat temporay thumb image in PHP

Hey, i am looking for a method to creat temporay thumb file in PHP. Is there any way not to store the image on the server or delete them right after. What I am looking for is a solution like this: http://www.dig2go.com/index.php?shopbilde=772&amp;type=1&amp;size=120 Could some one explain to me how the php code behind this works? For th...

How do I prevent Visual Studio from creating obj folders in my source directory?

I've set the OutputPath, IntermediateOutputPath, and BaseIntermediateOutputPath tags in all my csproj files. Despite that, Visual Studio creates extra "obj" folders in my source directories. As far as I can tell, it creates the directory obj\Debug\TempPE and then leaves it empty. I don't mind Visual Studio creating all sorts of crap, bu...

How do you deal with temporary picture uploads in PHP?

I'm creating an online game in PHP where users can create playable characters. Each character can have a user-uploaded portrait. A player can simultaneously have multiple characters, and the pictures for them can be changed anytime. Naturally, the pictures have to be resized and re-compressed to avoid huge files. Here's my problem: When...

Temporary files in .Net

I need to create some bitmaps and save them to the file system. For some reason the MScharting system wants it's background files supplies as paths in string form. I'm dynamically creating the background image, although only a few times. What's the best way to create these files and then clean them up? ...

sqlite - temporary data in memory

hi, my situation: i have a file based sqlite db and want to have all temporary stuff done in memory (temp databases for large queries, etc). i tried using the PRAGMA temp_store = 2 command, but i am not 100% sure if it really does what i want. the strange thing is that while debugging i still reach the function winGetTempname which open...

Rsync create new file on file size change

Hi All, I need to backup (for debugging) some temporary files meanwhile a program running. I used to do it with rsync-ing the /var/tmp/someprogram directory with find . -iname 'blahblah' -exec rsync -someoptions $DESTdir, which works wonderful. Except the case of someone in some program (for which I don't have source code access, and n...

::CreateFile with the FILE_FLAG_DELETE_ON_CLOSE flag.

Before I describe my problem, here is a description of the program (IHExplorer.exe) I'm writting: This is a C++ application. The IHExplorer application is to look as much like a Windows Explorer window as possible. With one exception, and that is that launching files from within this Explorer window will decrypt them first to the user'...

Adding an image to a JTooltip without knowing the image's path (due to the image being a temporary ressource)

To be a little more specific: I've built a simple multithreaded TCPServer (Java) which communicates with clients (C# / mono). On request the Clients take a screenshot and send it to the Server. The screenshots are then displayed in a JTable. I'd like to add a tooltip to these images in the table with the same image but in another size. T...

Limitations of TEMP directory in Windows?

I have an application written in Python that's writing large amounts of data to the %TEMP% folder. Oddly, every once and awhile, it dies, returning IOError: [Errno 28] No space left on device. The drive has plenty of free space, %TEMP% is not its own partition, I'm an administrator, and the system has no quotas. Does Windows artificia...

Java Project Modules - use InputStream/OutputStream or .tmpFile/byte[]

Hi all, I found myself passing InputStream/OutputStream objects around my application modules. I'm wondering if it's better to - save the content to disk and pass something like a Resource between the various methods calls - use a byte[] array instead of having to deal with streams everytime. What's your approach in these situatio...

Font.createFont leaves files in temp directory

The code below does its work but leaves copies of the font file in the temp directory each time it is run. These files are named +~JF7154903081130224445.tmp where the number seems random for each created file. InputStream fontStream = this.getClass().getResourceAsStream("handsean.ttf"); Font baseFont = Font.createFont(Font.TRUETYPE_FONT...

Create temporary file and auto removed

Hi all, I am writing a anti-leeching download script, and my plan is to create a temporary file, which is named by session ID, then after the session expires, the file will be automatically deleted. Is it possible ? And can you give me some tips how to do that in PHP ? Thanks so much for any reply ...

Use pyExcelerator to generate dynamic Excel file with Django. Ensure unique temporary filename.

I'd like to generate a dynamic Excel file on request from Django. The library pyExcelerator does this, but I haven't found any way to use the contents of the Excel file without generating a server-side temporary Excel file, reading it, using its contents and deleting it. The problem is that pyExcelerator only way to extract the contents...