files

Checking existence of a txt file with C++ code

First of all, i'd to establish that i do have the text file in my Folders directory. Im using visual studio and it is where my source code is compiling. The code below should demonstate why its not working. In visual studio. int main( const int argc, const char **argv ) { char usrMenuOption; const char *cFileName = argv[ 1 ]; ...

read file in an applet

Hi there I want to read out a file that lies on the server. I get the path to the file by a parameter <PARAM name=fileToRead value="http://someserver.de/file.txt"&gt; when I now start the applet following error occurs Caused by: java.lang.IllegalArgumentException: URI scheme is not "file" Can someone give me a hint? BufferedReader ...

How does python close files that have been gc'ed?

I had always assumed that a file would leak if it was opened without being closed, but I just verified that if I enter the following lines of code, the file will close: >>> f = open('somefile.txt') >>> del f Just out of sheer curiosity, how does this work? I notice that file doesn't include a __del__ method. ...

jquery read/write to file

Is there a way to get jquery to get information to and from a file... let say i ask a question and i like to get the answer in a file.. to keep track.. is it possible? how? ...

Recursively search directories moving specified file type from one location to another preserving directory structure.

Is there some way to specify a directory (let's say "C:\images") and move every .jpg file from there to another directory (say "D:\media") but preserve the directory structure (so if the file were "C:\images\paintball\july\07\headshot.jpg" after moving it would be "D:\media\paintball\july\07\headshot.jpg")? I'm using cygwin (but would b...

Can any one help me mail attachment script in php?

Duplicate: http://stackoverflow.com/questions/536838/php-attaching-an-image-to-an-email I need mail attachment script in php, and attachment should be multiple files can any one help me? ...

What's the difference between iterating over a file with foreach or while in Perl?

I have a filehandle FILE in Perl, and I want to iterate over all the lines in the file. Is there a difference between the following? while (<FILE>) { # do something } and foreach (<FILE>) { # do something } ...

Java keeps lock on files for no apparent reason

Despite closing streams in finally clauses I seem to constantly run into cleaning up problems when using Java. File.delete() fails to delete files, Windows Explorer fails too. Running System.gc() helps sometimes but nothing short of terminating the VM helps consistently and that is not an option. Does anyone have any other ideas I could...

Regex on an array?

Hi How do I get the percentage and filesize from this sort of string using regex in PHP? The thing is I get this string using the print_r function like so: while(!feof($handle)) { $progress = fread($handle, 8192); print_r($progress); } The above outputs something like this: [download] 28.8% of 1.51M at 171.30k/s ETA 00...

Overhead of log information in files

Hello, I am doing some long simulations that can take from several hours to several days and I am logging the information into files. The files can reach sizes of hundreds of Mb and inside there is just a list of numbers. I am really concern about the overhead that this is originating. I would like to ask if the overhead of using this m...

Verifying an uploaded File's content type using ASP.Net

How can I verify a files content type without using the files extension or mime type using ASP.Net. I don't want to use the mime type because it appears to be determined by the file extension. ...

Downloading files

Hello, I am using asp.net/C#. I have a url to a folder on a remote server. In that folder are images that are all .jpgs. I don't know the names of the files, just that they are all .jpgs. How do I download all the .jpg images using asp.net/C# to a folder on my local hard drive. Just to clarify. I am pulling files from a remote server a...

How to atomically rename a file in Java, even if the dest file already exists?

I have a cluster of machines, each running a Java app. These Java apps need to access a unique resource.txt file concurently. I need to atomically rename a temp.txt file to resource.txt in Java, even if resource.txt already exist. Deleting resource.txt and renaming temp.txt doesn't work, as it's not atomic (it creates a small timefram...

Merging 3 different files

Similiar to: http://stackoverflow.com/questions/170309/three-way-merge http://stackoverflow.com/questions/460198/best-free-3-way-merge-tool-for-windows I am running 2 websites. One is running .net 3.5, the other is not. On the site that is running 3.5 I also have the older version. Right now, I am going through the 3.5 and the 2.0 lo...

Best practices for custom file structures

I'm currently quite curious in how other programmers organise data into files. Can anyone recommend any good articles or books on best practices for creating file structures? For example, if you've created your own piece of software for whatever purpose, do you leave the saved data as plain text, serialize it, encode to xml, and why do ...

Too many open files

I get an EInOutError with message 'Too many open files' when executing this code block repeatedly for some time from a number of client threads: var InputFile : Text; ... Assign (InputFile, FileName); Reset (InputFile) try // do some stuff finally CloseFile (InputFile); end; The number of client threads is approximately 10, so on...

Progress bar in uploading Xml file.

Hi, i want to use a background thread for the process of loading the XML data, possibly with a progress bar to let the user know that the application is actively doing something. i have written this code through searching the net. i want to load a XML tree in treeview on winform when a user cliks a Browse button. In case of a large XML ...

ASP.NET Setup Project - how to include static files not in VS?

I am working on an ASP.NET MVC web application, and am working on the Web Setup portion. We are using SVN for version control. One of the issues is that the we are currently having is that the web designers modify and add a lot of html, css and js files that end up in the Content folders, but they don't add them to the VS project, so the...

Securing a PHP file manager from its users

Hello everyone, I'm developing a photo sharing web site using the CodeIgniter PHP framework. The idea is that people could upload their photos, manage them (through some sort of file browser which allows them to create subfolders, drag files around, etc) and edit them (some basic things like resizing, rotating and cropping to start with,...

Reading File Names

Hi All, I was wondering if there's an easy way in C++ to read a number of file names from a folder containing many files. They are all bitmaps if anyone is wondering. I don't know much about windows programming so I was hoping it can be done using simple C++ methods. Thanks! ...