file

read from file as char array

I am reaing from a file, and when i read, it takes it line by line, and prints it what i want exactly is i want an array of char holding all the chars in the file and print it once, this is the code i have if(strcmp(str[0],"@")==0) { FILE *filecomand; //char fname[40]; char line[100]; ...

Working with files

I hope I formatted the code correctly this time. Let me say first that the code works as is; it's in understanding some parts and modifying others that I run into trouble. I'm going to delete my numerous comments and limit myself to a few questions on it. 1. Is FILE a keyword in Obj-C? What is its function? Why all caps? 2....

Most efficient way to compare a memorystream to a file C# .NET

I have a MemoryStream containing the bytes of a PNG-encoded image, and want to check if there is an exact duplicate of that image data in a directory on disk. The first obvious step is to only look for files that match the exact length, but after this I'd like to know what's the most efficient way to compare the memory against the files....

Deleting a line from a txt file in objective-c

Is there a way to remove a line from the end of a .txt file from Objective-C? I can't seem to find anything on manipulating text files from Objective-C, only reading them into a NSString. ...

read url in binary mode in java

In java I need to read a binary file from a site and write it to a disk file. This example http://java.sun.com/docs/books/tutorial/networking/urls/readingURL.html could read webpages succesfully, but when I try to read a binary file from my localhost server and write it to a disk file the contents change, corrupting the binary file. Usin...

Java: CSV file read & write.

Im reading in 2 csv file: store_inventory & new_acquisitions... I want to be able to compare the store_inventory csv file with new_acquisitions. 1) If the item names match just update the quantity in store_inventory. 2) If new_acquisitions has a new item that does not exist in store_inventory, then add it to the store_inventory. Heres ...

VB to c++ or c#?

I am trying to translate this code but I don't understand how to use the GET / PUT part of the code in another language like c++ or c#. This is the code : Private Sub cmd_Click() Dim i As Integer, a As Integer a = 10 For i = 1 To a Dim file As String Open "txt" For Binary As #1 file = Space(LOF(1)) Get #1, , file Cl...

Reuse C++ Header files

Guys, I have a Visual C++ solution with 2 projects AlgorithmA & AlgorithmB and both share a common header file RunAlgo.h with the class declaration. Each project in the solution has its own unique implementation for the header file. I am trying to compile a DLL out of the common header file RunAlgo.h and add reference to this DLL i...

Django dislaying upload file content

hello, i have an application that loads different documents to the server, and allows users to read documents' content. i am uploading the documents to the server, and then i try to read the courses by id, like: def view_course(request,id): u = Courses.objects.get(pk=id) etc But i don't find anywhere : how can i actually read the ...

What is the best option for reading Java property files?

Hello I have an application which uses a servlet to read an intialization parameter from web.xml for the location of a property file. The serlvet then creates an instance of a class which stores the location of the file for other programs to read as required. This class has appropriate get and set methods. But my question concerns acce...

Moving to an arbitrary position in a file in Python

Let's say that I routinely have to work with files with an unknown, but large, number of lines. Each line contains a set of integers (space, comma, semicolon, or some non-numeric character is the delimiter) in the closed interval [0, R], where R can be arbitrarily large. The number of integers on each line can be variable. Often times I ...

accessing files after setup.py install

I'm developing a python application and have a question regarding coding it so that it still works after an user has installed it on his or her machine via setup.py install or similar. In one of my files, I use the following: file = "TestParser/View/MainWindow.ui" cwd = os.getcwd() argv_path = os.path.dirname(sys.argv[0]) file_path = o...

best practices question: How to save a collection of images and a java object in a single file? File is read to be rendered

Hi all, I am making a java program that has a collection of flash-card like objects. I store the objects in a jtree composed of defaultmutabletreenodes. Each node has a user object attached to it with has a few string/native data type parameters. However, i also want each of these objects to have an image (typical formats, jpg, png etc)...

how to validate php file with w3c.org

Hi I want to validate my php project to meet the w3 standard so ...Can some one explain how to do the php file validation usind w3c.org ...

Why can't I add to the middle of an array with Perl's Tie::File?

File : #comment1 #comment2 #comment3 #START HERE a: [email protected] b: [email protected] my perl program : use Data::Dumper; use Tie::File; tie my @array, 'Tie::File', 'ala.txt' or die $!; my $rec = 'p: [email protected]'; my $flag =1 ; my $add_flag = 0; for my $i (0..$#array) { next if ($array[$...

Open files on client side from ORACLE Forms

I'm trying to put a code on a button so that the user would be able to open a specific excel file whenever he pressed it , unfortunately the code i was using ( AppID ) happened to be opening the file on the server side not the client side ; please find the code below : DECLARE AppID PLS_INTEGER; BEGIN AppID := DDE.App_...

How to receive/send files with a java Webservice

Hi! So i'm writing a WebService in Java that should receive a file as an input, and then the WebService does some processing on that file, and finally it should send a new file to the client. My question is : How do I send a file to the client? (and how can I tell them to upload one). Thanks for the help ...

is it possible to store structure in Text file using c#

i like store the structure in to the Text file and also retrive the same. i created a structure name student details consists the values studentid,student name,student avg.i like to store this structure details in Textfile for many students.after that i like to reteive that details from Textfile using student id.i am working in wondows...

Attach file to mail using php

Hi all, I've created a form which contains an upload field file and some other text fields. I'm using php to send the form's data via email and attach the file. This is the code I'm using but it's not working properly. The file is normally attached to the message but the rest of the data is not sent. $body="bla bla bla"; $attachment ...

python - file copy completion?

In Linux, How can we know if a file has completed copying before reading it?. (In Windows, OSError is raised.) ...