temporary-files

Force close file by its path on Windows

∥☆過路亽.° 提交于 2019-11-28 02:01:52
问题 I'm writing a temporary file manager for other developers. I want to remove files even our console applications crashes or being closed by "X" button. So far I found std::set_terminate , std::atexit and SetConsoleCtrlHandler methods with which I can delete all temporary files I need. Problem is - I can't delete opened files. Furthermore - I cant control streams to those files, cause developers using several libraries (GDAL for example) which uses their own stream mechanisms and can accept

PHP temp file names for uploads colliding

五迷三道 提交于 2019-11-28 00:07:10
问题 When a user uploads a file, randomly it gets replaced by another user's upload, I've finally tracked down the issue to PHP and the tmp file name being reused. Is there a way to fix this? Is there a way to make better random names? It seems to degrade over time, as in the random file name seed gets weaker? This is on PHP 5.2.8 and FreeBSD 7.0 Here is a log showing how the same tmp file name gets used and is overwritten by another upload: http://pastebin.com/m65790440 Any help is GREATLY

Delete on close files

痴心易碎 提交于 2019-11-27 23:37:54
Language used: C# Theory: I want to create a file with the flag FileOptions.DeleteOnClose in a temporary folder. The file is successfully created and I write dato onto it, the next step is to launch the application associated with the file Process.Start(...) and allow the user to inspect the document, finally I close my handle and as soon as other process close the handle to the temporary file, the file is deleted by operating system. My problem is that other processes cannot open the file, even for reading, despite if I add FileShare.ReadWrite | FileShare.Delete to the sharing mode. Any

Pipe vs. Temporary File

落爺英雄遲暮 提交于 2019-11-27 19:57:38
问题 Is there a big performance difference between: Process A writing to a temp file, and process B reading that file Process A writing to a pipe, and process B reading from that pipe I'm curious to know what the answer is for both Windows and *nix. EDIT: I should have asked: Does the buffer cache eliminate the difference between a temp file and a pipe? 回答1: One big difference is that with the pipe, processes A and B can be running concurrently, so that B gets to work on the output from A before A

ReflectedSchemas folder in the user's AppData folder (Visual Studio)

我只是一个虾纸丫 提交于 2019-11-27 19:20:07
Today I ran WinDirStat to check what is filling up my harddisk. I was surprised to see that this folder contains 4.6 GB (!): C:\Users\...\AppData\Roaming\Microsoft\VisualStudio\9.0\ReflectedSchemas What is the purpose of this folder and the files it contains? Is there a way to get rid of these files in a safe way? Thanks! I've tried to empty the folder completely, and have no problems found since i've done. When launching a project in VS, a new schema was created. Edit: you can also move the folder and put it back when you believe you screwed things up... This drives me crazy and hopefully it

Permission Denied To Write To My Temporary File

醉酒当歌 提交于 2019-11-27 14:59:48
I am attempting to create and write to a temporary file on Windows OS using Python. I have used the Python module tempfile to create a temporary file. But when I go to write that temporary file I get an error Permission Denied . Am I not allowed to write to temporary files?! Am I doing something wrong? If I want to create and write to a temporary file how should should I do it in Python? I want to create a temporary file in the temp directory for security purposes and not locally (in the dir the .exe is executing). IOError: [Errno 13] Permission denied: 'c:\\users\\blah~1\\appdata\\local\\temp

C++: Getting a temporary file, cross-platform

你。 提交于 2019-11-27 14:19:43
问题 I'm looking for a cross-platform way of getting designated a temporary file. For example in linux that would be in the /tmp dir and in Windows in some crappy named Internet Explorer temp dir. Does a cross-platform (Boost?) solution to this exist? EDIT : I need this file to exist until the program terminates. tmpfile() does not guarantee that. Quoting from ccpreference: The temporary file created is automatically deleted when the stream is closed (fclose) or when the program terminates

iPhone storage in tmp directory

こ雲淡風輕ζ 提交于 2019-11-27 14:10:53
I have a question from this stackoverflow question about iPhone storage . Like I already tried to answer, we can cache data in tmp directory. But a comment says that the data can be deleted when OS whimp. I don't understand exactly the problem that the comment says. I want to ask if the process of OS deleting tmp directory is manually or automatically. In other words, if the system auto detect that our tmp directory has to be deleted. Another question is that if we can control, or be asked to do something (before the deleting process) that can help us to keep the tmp directory. Another

When are Java temporary files deleted?

▼魔方 西西 提交于 2019-11-27 10:24:35
问题 Suppose I create a temporary file in Java with the method File tmp = File.createTempFile(prefix, suffix); If I do not explicity call the delete() method, when will the file be deleted? As an intuition, it might be when the JVM terminates, or earlier (by the Garbage Collector), or later (by some Operating System sweeping process). 回答1: The file won't be deleted automatically, from the JavaDoc: This method provides only part of a temporary-file facility. To arrange for a file created by this

git ignore vim temporary files

a 夏天 提交于 2019-11-27 08:57:41
问题 What is the correct way to make git ignore temporary files produced by vim in all directories (either globally across the system or locally for a single project)? 回答1: Vim temporary files end with ~ so you can add to the file .gitignore the line *~ Vim also creates swap files that have the swp and swo extensions. to remove those use the lines: *.swp *.swo This will ignore all the vim temporary files in a single project If you want to do it globally, you can create a .gitignore file in your