file

Determine the real type of file vb.net

I have a asp.net vb.net app, with a upload file control, when i upload the file i can get the type of file the extension : .(extension), But if the user change the extension how i can get the real type of file? Any ideas?? ...

Is there a posix-way to ensure two files are flushed in sequence without blocking?

In my program, I hold two files open for writing, a content-file, containing chunks of data, and an index-file, containing a map over which chunks of data has been written so far. I would like to flush them both to disc, as performant as possible, with the only constraint that the blocks in the data-file must be written before the corre...

Grabbing windows file information.

In C following this article (http://blogs.msdn.com/oldnewthing/archive/2006/12/21/1340571.aspx), we have succesfully been able to grab the file version information out of windows files however there are some files that seem to have a different mechanism for storing the version information that is not addressed in the article and was wond...

File Upload in GXT discriminates against certain file types

We are using GXT (EXT + GWT) and Apache commons file upload servlet utility. We have file uploads working but certain types are not uploaded, e.g., text files. Even if the text files have their extension changed they are still not uploaded. In the FileUploadBase.parseRequest method this is the code that seems to be found to skip the...

Deleting a possibly locked file in c

I am using fcntl locks in C on linux and have a dilemma of trying to delete a file that may possibly be locked from other processes that also check for the fcntl locking mechanism. What would be the preferred way of handling this file which must be deleted, (Should I simply delete the file w/o regard of other processes that may have read...

Locking a file to verify a single execution of a service. How reliable?

Hello, I am deploying a little service to an UNIX(AIX) system. I want to check if there is no active instance of that service running when starting it. How reliable is to implement that check like this? Try to acquire a lock on a file (w/ FileChannel) If succeeds, keep lock and continue execution If fails, exit and refuse to run the m...

Generate a collection of changed lines between two revisions of a file using Java

I am writing an eclipse plugin which needs to be able to determine which lines of a file have changed compared to a different version of the same file. Is there an existing class or library which I can use for this task? The closest I have found is org.eclipse.compare.internal.merge.DocumentMerger. This can be used to find the informat...

Is there a programmatic way to determine whether the file is being used?

Case and point: I need to open an Excel file via Interop and it would help a lot to avoid ugly COM errors if I knew that the file was in use. Other than trying to open the file and catching the exception, is there a programmatic way to determine whether the file is in use? ...

PushbackReader without EOF?!

Hello SOers, I'm currently using PushbackReader and while waiting for where it 'supposed' to be an EOF, I get the character 65535 and I'm wondering if that's normal. Where is my EOF?! Thank you. ...

file array output printing

hi i am using an array of file, i mean input type ="file" to upload number of files at a time. i want to print or echo that file array values , how can i do this. please help me Thanks ...

How does one programmatically download files from the web?

How are files downloaded from servers in programming languages like C? I understand higher level languages have magic functions like "download_file_from_url()" but they don't help me understand what is actually going on. I'm a little familiar with sockets but network programming in general is still a black box to me. Thanks for any help....

Is there a nice, safe, quick way to write an InputStream to a File in Scala?

Specifically, I'm saving a file upload to local file in a Lift web app. ...

How do I serve a binary file through rack?

I think I'm being a bit silly here, but I keep getting errors complaining about the SERVER_NAME key missing from the env hash, and I can't find any substantial documentation on Rack::SendFile.. so- how do I serve up files? ...

File Glob in C++

What's the C++ way of Perl's idiom: my @files = glob("file*.txt"); foreach my $file (@files) { # process $file } ...

improving data extraction from text file in Java

I have CSV file with sample data in this form : 220 30 255 0 0 Javascript 200 20 0 255 128 Thinking in java , where the first column is height, second thickness, next three are rgb values for color and last one is title. All need to be treated as separate variables. I have already written my own solution for this, ...

PHP File Upload, using the FILES superglobal array

Hello everybody, I just have a quick question. Let's say that I'm setting up an upload feature for a project. I'm using PHP5, and I was wondering if by using the $_FILES superglobal array, I could have access to the "tmp_name" array key , which is the temporary path and name of the file being uploaded to display a preview of the image,...

Python: Huge file reading by using linecache Vs normal file access open()

Hi, I am in a situation where multiple threads reading the same huge file with mutliple file pointers to same file. The file will have atleast 1 million lines. Eachline's length varies from 500 characters to 1500 characters. There won't "write" operations on the file. Each thread will start reading the same file from different lines. Whi...

blackberry upload file to web server

how to upload .doc file from blackberry mobile to web server like resume attachment Please do reply me. ...

Fatal error when using FILE* in Windows from DLL

Hi there. Recently, I found a problem with Visual C++ 2008 compiler, but using minor hack avoid it. Currently, I cannot use the same hack, but problem exists as in 2008 as in 2010 (Express). So, I've prepared for you 2 simple C file: one for DLL, one for program: DLL (file-dll.c): #include <stdio.h> __declspec(dllexport) void print_t...

Blackberry read local properties file in project

Hi, I have a config.properties file at the root of my blackberry project (same place as Blackberry_App_Descriptor.xml file), and I try to access the file to read and write into it. See below my class: public class Configuration { private String file; private String fileName; public Configuration(String pathToFile) { this.fileName =...