file

There is in Windows file systems a pre computed hash for each file?

I want to search a file duplicate by its hash. For performance purposes I want to know if there is a stored hash/checksum for each file in NTFS/FAT file systems. If there is, I don't have to compute them all to search my file. If there is, how to access it using .NET? If it helps, it will be JPEG files. Do they have a checksum? ...

Specifying Java path for properties file

I have a Java Spring project, configured with Maven. As the amount of unit tests and their configuration files is adding up rapidly, I'm trying to centralize the test configurations to one properties file (the same one, which is used in building the project). The unit tests are located (relative to the project path, of course) in tree s...

web service - mobile application (j2me) file transfer

What i'm trying to do is transfer an image from the web service to the mobile client. In order to do this i've created a web service operation that returns a byte[] variable. In this method i create an .png image from a chart. After this i get the bytes from the image and provide them as a return value for the operation. this is the serv...

The right way to manage a big matrix in Java

I'm working with a big matrix (not sparse), it contains about 10^10 double. Of course I cannot keep it in memory, and I need just 1 row at time. I thought to split it in files, every file 1 row (it requires a lot of files) and just read a file every time I need a row. do you know any more efficient way? ...

iPhone : Get the file path which is within subfolder of Resourse folder

hi all, i am new to iphone programming. i want to read the content of text file which is located in subfolder of Resourse folder Resourse Folder Structure is following Resourse Folder1---->Data.txt Folder2---->Data.txt Folder3--->Folder1----->Data.txt There are multiple file named "Data.txt". so how can i access each folder file. i...

How to treat the first line of a file differently in Python?

I often need to process large text files containing headers in the first line. The headers are often treated differently to the body of the file, or my processing of the body is dependent on the headers. Either way I need to treat the first line as a special case. I could use simple line iteration and set a flag: headerProcessed = false...

Java: Howto get the thumbnail from a file

Hello, In windows explorer (and linux gnome) views for each file a thumbnail / icon. Like with EXEs, images, videos, txt-files, ini-files and so much other file types. Now is my question: Is there a way to get them by file. Something like: public static BufferedImage getThumbnail(File file) {...} Thanks ...

How do I open an array of files in Perl?

In perl, I read in files from a directory, and I want to open them all simultaneously (but line by line) so that I can perform a function that uses all of their nth lines together (e.g. concatenation). my $text = `ls | grep ".txt"`; my @temps = split(/\n/,$text); my @files; for my $i (0..$#temps) { my $file; open($file,"<",$temps[$i...

storing an array in a file in java

Hello, I plan to store an array of numbers in a file and read it when needed. What would be a good way to do this? I can think of afew ways such as storing each element in a line as a text file or serialize it and store / call by that method. Speed is my first concern. Thanks ...

How to create a link that triggers file download?

When a user clicks a "Download PDF" link, I would like for the download prompt to appear and for the user to be able to download the file. Currently, the user is just transferred to the address of the PDF file. For example: <a..[what goes here??]..>Download PDF</a> It seems that there's a combination of JavaScript & PHP needed to do...

How to get a remote-file's mtime before downloading it in Ruby?

I have the below code, which simply downloads a file and saves it. I want to run it every 30 seconds and check if the remote-file's mtime has changed and download it if it has. I'll be creating a thread which sleeps 30seconds after every iteration of an endless loop for that purpose, but; how do I check a remote file's mtime without down...

Why does wide file-stream in C++ narrow written data by default?

Honestly, I just don't get the following design decision in C++ Standard library. When writing wide characters to a file, the wofstream converts wchar_t into char characters: #include <fstream> #include <string> int main() { using namespace std; wstring someString = L"Hello StackOverflow!"; wofstream file(L"Test.txt"); ...

PHP: read last line from file

I've been bumping into a problem. I have a log on a Linux box in which is written the output from several running processes. This file can get really big sometimes and I need to read the last line from that file. The problem is this action will be called via an AJAX request pretty often and when the file size of that log gets over 5-6MB...

py2exe and the file system

I have a Python app. It loads config files (and various other files) by doing stuff such as: _path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) CONFIG_DIR = os.path.join(_path, 'conf') This works fine. However, when I package the app with py2exe, bad things happen: File "proj\config.pyc", line 8, in <module> Window...

writing to the middle of a file in ruby

I've opened a file in ruby with the options a+. I can seek to the middle of the file and read from it but when I try to write the writes always go to the end. How do I write to a position in the middle? jpg = File.new("/tmp/bot.jpg", "a+") jpg.seek 24 puts jpg.getc.chr jpg.seek 24 jpg.write "R" jpg.seek 28 jpg.write "W" puts jpg.pos j...

php file/folder treeview with descriptions script?

Hi, I am displaying a file/folder structure using a treeview component using PHP, for an online library. Now I need to be able to add optional descriptions to each folder/file, so I guess I need to cross this with a mysql database. I was wondering if someone knows of an opensource script that will let you do this, so as not to have to ...

? in my file name

is there any way to write ? mark in a file name ...

Indexing a set of key pair values for use in J2ME Application

I have some 1000 key-pair values that I will use in my j2me application, reading it from a resource file. However I will be using only a few of those values at any time, say 10, based on the record number being generated inside the application logic. Loading all the values into memory and then looking up is fairly not an efficient option...

C# How do I upload a file to a PHP server?

I need to upload a file to my webserver from a C# program. The problem is, I need to also POST two strings at the same time. So far, I have: HttpWebRequest HttpWReq = (HttpWebRequest)WebRequest.Create("http://localhost/test.php"); ASCIIEncoding encoding = new ASCIIEncoding(); string postD...

How to change read attribute for a list of files?

I am powershell newbie. I used a sample script and made substitute from get-item to get-content in the first line. The modified script looks like below: $file = get-content "c:\temp\test.txt" if ($file.IsReadOnly -eq $true) { $file.IsReadOnly = $false } So in essence I am trying to action items contained in test.txt stored as UNC pat...