file

Reverse massive text file in Java

What would be the best approach to reverse a large text file that is uploaded asynchronously to a servlet that reverses this file in a scalable and efficient way? text file can be massive (gigabytes long) can assume mulitple server/clustered environment to do this in a distributed manner. open source libraries are encouraged to conside...

NSFileManager crashing in app delegate

I have this code in a method called from applicationDidFinishLaunching. It works in the simulator, but crashes on the iPhone. There are about 1,600 2KB mp3 files being copied in this operation. If I try to instantiate the app multiple times, it will eventually copy more each time until the app eventually will start without crashing. I am...

php return elements from file content

Pretty simple i'm sure, but.. I've got a file that is guaranteed to have only an <h1>some text</h1> and a <p>some more text</p> in it. How would i go about returning these to elements as separate variables? ...

c source code to remove subset transactions from text file

I have a file containing data as follows 10 20 30 40 70 20 30 70 30 40 10 20 29 70 80 90 20 30 40 40 45 65 10 20 80 45 65 20 I want to remove all subset transaction from this file. output file should be like follows 10 20 30 40 70 29 70 80 90 20 30 40 40 45 65 10 20 80 Where records like 20 30 70 30 40 10 20 45 65 20 are rem...

Is there a java library equivalent to file command in unix

Is there any java library that is similar to unix's command file? ie: $ file somepicture.png somepicture.png PNG image, 805 x 292, 8-bit/color RGB, non-interlaced The file command is such a nice tool. I need something that can tell me if the file is really what I want it to be. (ie a picture, document etc) I know I can run the comm...

php : get file content and store file in particular folder

hi , i am getting file content from file_get_content funtion in php. and want to store that file in particular folder. how could i store that file in particular folder. $image = file_get_contents('http://www.affiliatewindow.com/logos/1961/logo.gif'); i want to save this image in particular folder. any idea abt it? ...

Defining Form Input with Dialog

Hi. I want my php application to allow the user to select a file from their computer. I then want to store the file's path, but I don't want to upload the file. With the <input type="file" />, the file is uploaded, which would take too long. Is there a way to do this? Maybe if I change the input's type to text with jquery right before ...

JSP Javascript upload file

I'm developing an web app with jsp,servlet in server side and javascript in client side. How can a i upload multiple files(images) to the server(and save them to the db)? ...

Is there a way to identify audio or image files in java, without use the file extension?

Supposing new audio and image types will be created, I want my filter to separate the images and audio files. Is there a way to recognize then? ...

PHP Download File with Include

How can I use PHP's include function to include a file and then modify the headers so it forces - at least that's how it's called - browsers to download ITSELF (the PHP file). Is it possible to also modify the preset save name, in order to change the extension from *.php to something else? Thanks in advance! ...

Finding most recently edited file in python

I have a set of folders, and I want to be able to run a function that will find the most recently edited file and tell me the name of the file and the folder it is in. Folder layout: root Folder A File A File B Folder B File C File D etc... Any tips to get me started as i've hit a bit of a wall...

what's the UNC path for local computer from a remote machine ?

I am writing a small utility program in IronPython to install applications on remote machine using managementclass which uses WMI. Now, the script would install an application on Machine_B from Machine_A, it works fine as long as you have the msi file on the local drive of the Target machine (Machine_B, in this case). I want to be able ...

Writing client file manager over COM API: need advice on what technology to use.

I am going to write a "file manager" which can be platform specific (windows) and i can choose between getting the data from COM object API or via REST API. The advise i need, is about which technology is the fastest learning and implementing for this kind of task? I hear a lot of buzzwords like GWT, Flex, Silverlight and others. Pers...

Maximum filename length on Blackberry

Is there a maximum filename length (or equivalent to MAX_PATH) on the BlackBerry operating system? ...

Android - cant read TXT files from SDcard on real mashine?

Hello! When I run the code bellow in the virtual android (1.5) it works well, TextSwitcher shows first 80 chars from each txt file from /sdcard/documents/ , but when I run it on my Samsung Galaxy i7500 (1.6) there are no contents in TextSwitcher, however in LogCat there are FileNames of txt files. My Code: public void getTxtFile...

access a file in python that is created from SunGridEngine

Hi guys i have a python script, that submits an job to the SGE (Sun Grid Engine). When the job is done i want to access the output file, generated from the SGE job. i see with "ls" in the directory that the file is already existing and the job is done, but python needs about 20-30 seconds to get access to that file... is there a way to ...

copy a text file

I am trying to copy a text file in an other text file line by line. It seems that there is a buffer of 1024 character. If there is less than 1024 character in my file, my function will not copie in the other file. Also if there is more than 1024 character but less a factor of 1024, these exceeding characters will not be copied. Ex: ...

Visual Studio Question: How to go to a specific file path and line number programmatically?

In the Visual Studio output window, you can double click a line that contains a file path and line number and it automatically takes you to that location. In my program, I need to mimic this behavior and be able to click something (a button for example) and do go to a specific file and line number that I tell it to go to. Any help/sugg...

How to create CommonsMultipartFile object given only a file.

I have a junit test method that takes a CommonsMultipartFile object as a parameter. I'm trying to create a FileItem object so I can pass it to the constructor, CommonsMultipartFile(org.apache.commons.fileupload.FileItem fileItem) To do that, I'm trying to create the FileItem object using the DiskFileItem constructor, DiskFileItem(ja...

Is there a way to identify that a file has been modified and moved?

I'm writing an application that catalogs files, and attributes them with extra meta data through separate "side-car" files. If changes to the files are made through my program then it is able to keep everything in sync between them and their corresponding meta data files. However, I'm trying to figure out a way to deal with someone modif...