files

The file is busy. I can't delete it.

I set copyright on the image. After that i need to delete the old file. But i can't because it's busy. I need rename the copyrighted file from "copyrighted_"+imageFile to imageFile. public static void SetImageCopyright(string imageFile) { #region //create a image object containing the photograph ...

Java library for extracting metadata

I have a binary file which has an ASCII metadata header. The elements are of the form "tag = value". Do you know of any Java libraries that will simplify extraction of this metadata. ...

How to test a folder for new files using python

Hello How would you go about testing to see if 2 folders contain the same files, and then to be able to manipulate ONLY the file which is new. A = listdir('C:/') B = listdir('D:/') If A==B ... I know this could be used to test if directories are different but is there a better way? And if A and B are the same, except B has one more ...

How can I download a file using WWW::Mechanize or any Perl module?

Is there a way in WWW::Mechanize or any Perl module to read on a file after accessing a website. For example, I clicked a button 'Receive', and a file (.txt) will appear containing a message. How will I be able to read the content? Answers are very much appreciated.. I've been working on this for days,, Also, I tried all the possibilitie...

How can I use a variable's value as a glob pattern in Perl?

In Perl, you can get a list of files that match a pattern: my @list = <*.txt>; print "@list"; Now, I'd like to pass the pattern as a variable (because it's passed into a function). But that doesn't work: sub ProcessFiles { my ($pattern) = @_; my @list = <$pattern>; print "@list"; } readline() on unopened filehandle at ... ...

How to serve static files via Rack?

Hi, I am currently developing a Rack-based application and want to redirect all file requests(e.g. filename.filetype) to a specified folder. Rack::Static only supports file requests for a special folder(e.g. "/media"). Do I have to write an own Rack middleware or does a out-of-the-box solution exist? Best regards ...

No O_BINARY and O_TEXT flags in Linux?

When using system-level IO in Linux, I noticed that the compiler recognized the O_RDONLY and O_RDWR flags, but it had no clue whatsoever as to the meaning of the O_BINARY and O_TEXT flags. Is this a Linux thing? ...

stat.h unavailable in Linux?

When I do #include <stat.h> in Linux, I get a compiler error. I need this library for the S_IWRITE flag, which in its turn is used in the context of system-level IO. Is stat.h unavailable in Linux? ...

Check if a file exist in the Server in ASP.NET

string jSFile = ResolveUrl("~/MyProject/JavaScripts/dir/test.js"); if (!System.IO.File.Exists(jSFile)) { ... } This code doesn't work and I guess it's the jSFile that doesn't work well with the IO.File.Exists but I know the jSFile has a valid path because when I use few line later Page.Clien...

components of an SPSS project

I have given some data in an excel sheet to a 3rd party for SPSS data processing. After completion of the processing, what are the files that I should get back from them. I have received one file with a ".sav" extension. I presume this file contains the imported data (from my excel file). I have received documents (.rtf - rich text f...

Find the files related to a software

Hello Friends, I have one doubt. I am doing a project related to system restore concept in Linux. There i am planning to perform application wise rollback in case of failure. Is there any way to figure out what are all the files used by an application in the system? Ok. I will make it a little clear. For instance consider the firefox ap...

how to count files? (iphone sdk)

Hi all, does anybody know how to count files of a directory? I couldn't find something similar in the class reference of NSFileManager. Thanks in advance. Sean ...

Java folder synchronisation class/library?

Is there a library or a class in JAVA that synchronizes one folder to another one, changing only the "target" folder? I need something really fast (ant sync task is way too slow, for 4 GIG it took 10 minutes, compared to 3 seconds for Allway Sync - a desktop software). Thanks! UPDATE : Should be open source too :) I found http://syncd...

What concurrency works with the java file system ?

Using java IO, it seems like forking a new process gives better ability for a process B to read data written by process A to file than what you could get if thread A wrote to a file that thread B is trying to read (within the same process). It seems like the rules are not comparable to the memory model. So what file-based concurrency wo...

Does the extention matter if you write a bytearray to a file?

Hello, I have a table in the database containing "files". I don't know their filetype. I need to export some stuff (including these files) and be able to import them into the same application. So I was thinking about saving the byte array as data.dat (unknown extension). and when importing just making a byte array from that file and put...

With Swing & Java, what is done by the "Swing-Shell" thread

Hi, with threads & swing, the event queue (event dispatch thread) is broadly presented & discussed. However, when examining the thread states with a Swing application, there's also a thread named Swing-Shell. With brief googling I couldn't find much details, mostly thread stack traces with bug reports etc. Can somebody describe shortl...

Open a Word template from resource with interop word

So, I have this word template as a resource in my application. I want to open it to create new documents, but have no idea how to do this. The following code doesn't work obviously, since the add method requires a filepath (and not the resource byte[] object... object tFalse = false; object missing = System.Reflection.Missing.Value; Wo...

Python multiple threads accessing same file

I have two threads, one which writes to a file, and another which periodically moves the file to a different location. The writes always calls open before writing a message, and calls close after writing the message. The mover uses shutil.move to do the move. I see that after the first move is done, the writer cannot write to the file a...

What does the code "DECLDIR __declspec(dllexport)" really do?

#ifndef _DLL_TUTORIAL_H_ #define _DLL_TUTORIAL_H_ #include <iostream> #if defined DLL_EXPORT #define DECLDIR __declspec(dllexport) #else #define DECLDIR __declspec(dllimport) #endif extern "C" { DECLDIR int Add( int a, int b ); DECLDIR void Function( void ); } #endif What does the code DECLDIR __declspec(dllexport) really do? ...

Reading text files into list, then storing in dictionay fills system memory ? (A what am I doing wrong?) Python

I have 43 text files that consume "232.2 MB on disk (232,129,355 bytes) for 43 items". what to read them in to memory (see code below). The problem I am having is that each file which is about 5.3mb on disk is causing python to use an additional 100mb of system memory. If check the size of the dict() getsizeof() (see sample of output). W...