file

In Java, what is the best/safest pattern for monitoring a file being appended to?

Someone else's process is creating a CSV file by appending a line at a time to it, as events occur. I have no control over the file format or the other process, but I know it will only append. In a Java program, I would like to monitor this file, and when a line is appended read the new line and react according to the contents. Ignore ...

File Body Search

Hello, Can anyone recommend a good tool for searching though the body of files (office, powerpoint ect). It needs to be integrated as part of a PHP site. Alternatively, any server side applications that could be used for creating indexes of the search terms. thanks ...

How can I catch all the exceptions that will be thrown through reading and writing a file?

In Java, is there any way to get(catch) all exceptions instead of catch the exception individually? ...

OutputStream delete file contents JAVA

I have files in who i need to record serialized object. I open ObjectOutputStream for writing in files. If i didnt wrote nothing in file, file content get deleted. I don't want content to be deleted when i make ObjectOutputStream. Any help? Edit: @Provides @ArticleSerializationOutputStream public ObjectOutputStream getArticleObjectOutp...

How do you subclass the file type in Python?

I'm trying to subclass the built-in file class in Python to add some extra features to stdin and stdout. Here's the code I have so far: class TeeWithTimestamp(file): """ Class used to tee the output of a stream (such as stdout or stderr) into another stream, and to add a timestamp to each message printed. """ def _...

Read data directly from file to RAM in C++

Hi all, Is there a way to directly read a binary file into RAM? What I mean is, is there a way to tell the compiler, here's the file, here's the block of RAM, please put the file contents in the RAM, off you go, quickly as you can please. Currently I'm stepping through the file with ifstream loading it into RAM (an array) 64bit block ...

How to create or write text file in servlet?

i have tried this code. I didn't create any file. I am doing this in netbeans where server is glassfish v2 public void create_file(String file_name) { FileWriter file_stream; BufferedWriter out_stream; try { file_stream= new FileWriter(file_name); this.out_stream = new BufferedWriter(file_stream)...

Buffered vs non buffered, which one to use?

I am sorry if this is a duplicate but I was not able to find a definitive answer to what is the best practice for each type. I would like to know what the appropriate conditions are that define when to use BufferedReader vs FileReader or BufferedInput/OutputStream vs FileInput/OutputStream? Is there a formula of sorts that will always ...

calculating time duration of a file

Dupe of calculate playing time of a .mp3 file im reading a audio file(for ex:wav,mp3 etc) and get a long value as duration.now i want to convert that long value into correct time duration(like,00:05:32) ...

Sorting contents of a file in place in linux

Hi all, I have a file which has multiple columns, whitespace separated. e.g: data1 data2 data3 data4 val1 val2 val3 val4 I need to sort the file based on values in different columns, i.e sometime based on value of column 1 sometime based on value of col2 ...

How to get the User ~/Library path in Java for the Mac OS

On the Mac OS, from what I understand you're suppose to store information in "/Library/Application Support/Your App Name" if the files are to be read by everyone. However when it comes to writing, this is an admin only folder. Therefore, if you want to write data, you need to store it to "~/Library/Application Support/Your App Name". No...

how to create a "Uploading! Pls wait..." msg for uploading excel file and load to SQL Server?

Currently, i have a working function that will let user to upload an excel file and thn insert the excel file data into the SQL Server. So, they might be thousand of records in an excel file, i would like to have a message like "Please wait while uploading..." during the process! i have tried on the update progress and javascript but bot...

Print text File to specific printer in java

Hi, My need is terribly simple and yet I can' figure out a simple way to do it. I have a text file, and I need to print it to a specific network printer. I know the name of the printer. Until now I have made a Printable class to print my file (ticket). public class TicketPrintPage implements Printable { private File ticket; ...

Python data/file Crc

I am wanting to generate and store a CRC (or similar) value for a given list of files which can be used as a comparison at a later point. Writing a function to do this is simple enough, but is there a more standard way to do it within the Python libs? The value generated does not need to be of any particular standard. ...

Upload a potentially huge textfile to a plain WSGI-server in Python

I need to upload a potentially huge plain-text file to a very simple wsgi-app without eating up all available memory on the server. How do I accomplish that? I want to use standard python modules and avoid third-party modules if possible. ...

How to get the size of a remote file with iPhone SDK ?

Hello everybody, My iPhone application downloads large files from the internet (videos, for instance). I'd like to display a progress bar, so I need to get the size of the remote file I'm trying to download (before downloading it, of course). I've searched, again and again, but nothing is working. Is there any way to do that ? Thank ...

Use .NET Remoting to transfer a file?

I'm using .NET remoting to communicate between a web site and a Windows service. They both live on different machines. I have a statically defined port number for use by all requests and responses. I also use this mechanism to transfer files from the web site to the Windows service box. I'm passing a Stream object in the object that ...

Write to file not working after hosting (publishing the web application) ASP.Net

Writing to a file is not working after hosting the web application, whereas they were working while developing and testing in my localhost on debug mode. What could be the problem in writing to a file after hosting? Is there any special permission that should be given to the folders/file? ...

PHP : How can I read an .XLS file's contents without saving it to the server?

I am working on a database program using PHP to keep track of the products we manage at my workplace. For this project, I need to be able to select an .XLS file which contains new product data. New data consists of the following fields: Type CHAR(3), Line CHAR(2), Number INT, Measure INT, Comments VARCHAR(255), Variation...

sharepoint file upload

I can upload a 250MB file to sharepoint 2007 but nothing larger. I have changed the two webconfig file, set the admin site to 2047MB and it still fails. Please help this was to be completed asap. thanx ...