temporary-files

C/C++ System portable way to change maximum number of open files

徘徊边缘 提交于 2019-12-13 15:05:56
问题 I have a C++ program that transposes a very large matrix. The matrix is too large to hold in memory, so I was writing each column to a separate temporary file, and then concatenating the temporary files once the whole matrix has been processed. However, I am now finding that I am running up against the problem of having too many open temporary files (i.e. the OS doesn't allow me to open enough temporary files). Is there a system portable method for checking (and hopefully changing) the

Using Tempfile to create a zip file in rails

我是研究僧i 提交于 2019-12-13 13:16:10
问题 I want to create a temporary .zip in rails. For creating zip file I am using rubyzip gem. Currently I am doing this: zfname = Tempfile.new(['somename','.zip'], Rails.root.to_s + '/tmp/') Zip::ZipFile.open(zfname.path, Zip::ZipFile::CREATE) do |zipfile| zipfile.add(file, basepath + file) end This generates following error: Zip::ZipError: Zip end of central directory signature not found Is it possible to use Tempfile for zip? If yes, what is wrong here? 回答1: In my rails app when I needed to

Develop a program in Stata to handle multiple files in work folder just like SAS using tempfile

淺唱寂寞╮ 提交于 2019-12-13 09:58:17
问题 I am developing this wrapper around tempfile in Stata to handle multiple datasets at the same time without having to save them in current directory. So in essence I want Stata to mimic SAS, and that is the reason the program name is work; the initial code is without any options and minimal functionality. I have adhere to your advice not to tokenize and program works; however the issue is once I recall the tempfile in further program, this program (work) do not pass the handle to the next to

creating a temporary file in python with FUSE

主宰稳场 提交于 2019-12-12 14:34:12
问题 I am trying to write a program using python-fuse, but I can't get file writing down. my file_class looks like this class FuseFile(object): def __init__(self, path, flags, *mode): debug(path) #debug(mode); self.file = tempfile.TemporaryFile(*mode); self.fd = self.file.fileno() self.path = path def write(self, buf, offset): head, tail = os.path.split(self.path) self.file.seek(offset); self.file.write(buf); return len(buf) def read(self, length, offset): file = apiCall("readfile",{"file":self

Do I need to delete tmp files created by my java application?

一世执手 提交于 2019-12-12 12:26:54
问题 I output several temporary files in my application to tmp directories but was wondering if it is best practise that I delete them on close or should I expect the host OS to handle this for me? I am pretty new to Java, I can handle the delete but want to keep the application as multi-OS and Linux friendly as possible. I have tried to minimise file deletion if I don't need to do it. This is the method I am using to output the tmp file: try { java.io.InputStream iss = getClass()

Rails 3: Errno::ENOENT exception

懵懂的女人 提交于 2019-12-12 04:42:35
问题 I have the code as following. It runs OK on my local machine `params[:file].each do |f| tmp = f.tempfile ext = File.extname(f.original_filename) basic_file_name = "#{session[:user]["id"]}_#{Time.new.to_i}#{ext}".downcase file = File.join(TEMPORARY_FILE_FOLDER, basic_file_name) FileUtils.cp tmp.path, file` But on my remote server which is a CentOS server, it gives me this `Errno::ENOENT in CustomController#process_custom_order No such file or directory - public/uploaded/709_1388758536.jpg`

C# On Quit WebPage Delete Files and Folders on Server with no user action

梦想与她 提交于 2019-12-12 01:29:58
问题 I have some problems to delete temporary folder and files on my server when users not finish some action in webpages and quit to other webpages. Initialy at Page Load folders are created to allow the user to load files.I have tried implementing destruction during Idisposable without success. Could someone point the best method to delete folders and files when user quit the page with no action or cancel button. 回答1: You can investigate the OnUnload event of the page but, honestly, your best

IIS caching project reference binaries

青春壹個敷衍的年華 提交于 2019-12-11 23:44:00
问题 I just had to debug an issue where Asp.Net seemed to be caching the dll's of projects referenced by the website, even after those were rebuilt The solution compiles, but at runtime Asp.Net references an out of date binary in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root, and throws an exception. (I don't think the specific exception is relevant, its simply the fact that the underlying code is old, in my case its an issue with LLBLGEN where entity indexes are out

How long are resources used (file descriptor and memory) for Java temporary files (jar_cache####.tmp)?

眉间皱痕 提交于 2019-12-11 12:01:47
问题 I"m running a Java application on a Linux system. I noticed that the application seemed to consume a lot of file handles (I get "Too many open files" after a few days). So when I use the 'lsof' command to dump all the files associated with the Java application, I get something like this: java 2690 root 239u REG 3,2 428057 94300 /tmp/jar_cache5782499018536796385.tmp (deleted) java 2690 root 240u REG 3,2 58955 94360 /tmp/jar_cache3818842806647031366.tmp (deleted) java 2690 root 241u REG 3,2

What is the shortcut to clear “Temporary ASP.NET Files” folder before running application?

二次信任 提交于 2019-12-11 10:09:00
问题 The problem is while running my code, i always come up to my old javascript files on VS.2010. I think its reason is Temporary ASP.NET Files folder. How can i clear the temp folder when i press to F5 ? 回答1: You can run a pre/post-build action (if these are available) which will do the job. 来源: https://stackoverflow.com/questions/3932677/what-is-the-shortcut-to-clear-temporary-asp-net-files-folder-before-running-ap