file

8086 Assembly interrupts for reading/writing binary to/from files?

I need to read in about 1KB or so of data at a time, manipulate it, and write it to another file. I need to do this for at least 100 MB. I have never done any file IO in assembly before. What interrupts do I need to call and what needs to be in what registers? ...

How can you find the most recently modified folder in a directory using Ruby?

How can you find the most recently modified folder (NOT A FILE) in a directory using Ruby? ...

How can I tell a shortcut from a file in a C# drag and drop operation?

I have a C# .NET 3.5 app that I have incorporated the DragDrop event on a DataGridView. #region File Browser - Drag and Drop Ops private void dataGridView_fileListing_DragDrop(object sender, DragEventArgs e) { string[] fileList = e.Data.GetData(DataFormats.FileDrop) as string[]; foreach (string fileName in fileList) { ...

Parsing data into HTML tables and categories

I am to import a file, say june.txt that would have data such as the following data: Sandy,820,384,133,18,408 Wanda,120,437,128,807,595 Jane,631,415,142,687,600 Andrea,179,339,349,594,986 Wanda,803,191,6,807,322 Jane,741,975,34,15,832 Jane,239,714,250,94,497 Andrea,219,188,411,584,713 And t...

Text file to string array in plain c?

I want to load a txt file into an array like file() does in php. I want to be able to access different lines like array[N] (which should contain the entire line N from the file), then I would need to remove each array element after using it to the array will decrease size until reaching 0 and the program will finish. I know how to read t...

Can I assign the same file pointer a second file?

function() { FILE *ptr; ptr = fileopen(file1.txt) fprint(ptr, some text) //print to file 1 if(second file needed) { ptr = fileopen(file2.txt) //open a second file, assign to same file pointer fprint(ptr, some text) //print to file 2 not working here? } } EDIT: Not printing to second file...However...

python file read

def file_open(filename): fo=open(filename,'r') #fo.seek(5) fo.read(3) fo.close() file_open("file_ro.py") I expect above program to return first 3 bytes from file . But it returns nothing. When I ran these in interactive python command prompt - I get expected output! ...

Python file.read() grabs more data than necessary, under the hood.

cat file_ro.py import sys def file_open(filename): fo=open(filename,'r') fo.seek(7) read_data=fo.read(3) fo.close() print read_data file_open("file.py") But strace says readlink("file_ro.py", 0x7fff31fc7ea0, 4096) = -1 EINVAL (Invalid argument) getcwd("/home/laks/python", 4096) = 18 lsta...

Can anyone help me with drag and drop functionality of files using javascript supported by all versions of IE?

Hi I have text box. when I drag and drop a file into it, the path or content of the file should be displayed. the major concern being it's compatibility with all versions of IE. I am a beginner in javascript programming. can anyone suggest any idea or some tricks to get through? It's very urgent. ...

sparse file usage in python

I'm creating sparse files in python as follows: >>> f = open('testfile', 'ab') >>> f.truncate(1024000) >>> f.close() when the file is done, it takes up 0 disk space, but its inode size is set to my truncated value (1000K): igor47@piglet:~/test$ ls -lh testfile -rw-r--r-- 1 igor47 igor47 1000K 2010-07-09 04:02 testfile igor47@piglet:...

Is there any solution for Grails to select a folder like <input type="file"

is there a solution to select a folderpath as comfortable like the input-file tag? ...

Django download file not working

I'm trying to make a script for downloading uploaded files, on the user's machine. The problem is that the download simply doesn't work (it either downloads me an empty file, or gives me some errors). the last error is: coercing to Unicode: need string or buffer, FieldFile found def download_course(request, id): course = Courses.ob...

Batch: Remove file extension

I have the following batch script from Wikipedia: @echo off for /R "C:\Users\Admin\Ordner" %%f in (*.flv) do ( echo %%f ) pause In the for-loop all files with the extension flv get echoed, but I want the make some actions with the file(s) where I need one time the file without the extension and one time with the extension. How...

Efficient bulk data transfer through I/O in Java

Is there an efficient mechanism in Java for transferring large amounts of data (~10 GB) back and forth between the disk and the network on a low-end machine? Low-end machine meaning a machine with much less than 10 GB of main memory. I want to efficiently transfer ~10GB portions of a file from one machine to another. ...

Batch: Remove a string from a string

I have the following batch script from Wikipedia: @echo off for /R "C:\Users\Admin\Ordner" %%f in (*.flv) do ( echo %%f ) pause I learned here that %%~nf returns just the filename without the extension. Now I just wanted to remove (Video) from the filenames (%%~nf). How could I do that? ...

How can I get a list of all mp3 files on the sd card regardless of directory in android?

Using code from open source MusicDroid with the following code that I found during a search for this problem, I can only get mp3 files that are in the root directory /sdcard/ File home = Environment.getExternalStorageDirectory(); if (home.listFiles( new Mp3Filter()).length > 0) { for (File file : home.listFiles( new Mp3Filter())) {...

Reading multiple records from Text file in C#

Hi all I need some logic/programming help with reading more than one record from a text file. I can read line for line, but I need to stop as soon as the record is finished, push that object to a list, and then continue with a new record until the next one comes up, save to list, etc... The header of the record always start with G as t...

Reads memory instead of File

Hi, I do have a very complicated problem here, and I really appreciate any help. We do have a very big program here which consists of very various parts which has been written by many various people which all of them are not available now! each part reads its data from its own files which makes it very hard to maintenance and ... . no...

How to read a local (res/raw) file line by line?

I have a text file in my res/raw directory. I want to read the file line by line, but FileReader and BufferedReader fail, because of Android's security restriction. How else can I do it? ...

Determine whether a file is in use in Perl on Windows

Hi there, I'm writing some Perl which takes TV shows recorded on Windows Media Center and moves/renames/deletes them depending on certain criteria. Since the Perl runs fairly frequently, I'd like to cleanly determine whether or not the file is in use (in other words, the show is in the process of being recorded) so I can avoid doing an...