file

Save batch file path to local harddisk

Hi, I have a batch file that is Run when a selfextraction file is executed. The self extracted files must be copied to to specefic place on the harddisc. In the batch file the user is asked where the path is (if it's not located the default place) Part of the batch file: @ECHO OFF IF EXIST "C:\Program Files\program\program.exe". ( ...

[iPhone]Objective C, objects which do not conform to NSCoding. How to write them to a file.

Hi, I am using an Objective c class, a subclass of NSObject. This class cannot be modified. I have an instance of this class that I wish to write to a file which can be retrieved and later reinstate. The object does not conform to NSCoding. To sum up, I need to save an instance of a class to a file which can be retrieved later, without ...

Read a text file and transfer contents to mysql database

I need a php script to read a .txt file. The content of the text file are like this: data.txt 145|Joe Blogs|17/03/1954 986|Jim Smith|12/01/1976 234|Paul Jones|19/07/1923 098|James Smith|12/09/1998 234|Carl Jones|01/01/1925 These would then get stored into a database like this *DataID |Name |DOB * 234 |Carl Jones|01/01/192...

The ultimate .NET file and directory utility library?

I find myself writing file and directory utility functions all the time, and I was wondering if there is good file and directory library that already implements a more extensive set than available by default in System.IO. The kind of functions I'm looking for is things like: public static void GetTemporaryDirectory() { string tempD...

How to save memory when reading a file in Php ?

I have a 200kb file, what I use in multiple pages, but on each page I need only 1-2 lines of that file so how I can read only these lines what I need if I know the line number? For example if I need only the 10th line, I don`t want to load in memory all the lines, just the 10th line. Sorry for my bad english! ...

*nix: "echo 'start working' > /etc/.example" : how is this implemented?

Say someone executes the following in a terminal: echo 'start working' > /etc/.example and when this is executed, the example program would "start working." On UNIX(-like) systems, how would something like that be implemented, and what is this kind of behavior called? ...

Hi, I want to create new DOCX file by reading DOCX template (it's content is already replaced)

Up to now code is read the template and replace with new values and finally replace the docx file with new values. Can any one please tell me how to save the replaced docx file in diffrent name?. My code is bellow. using (WordprocessingDocument wordDoc = WordprocessingDocument.Open(document, true)) { string docTe...

adding files to a project in Borland C++ builder X or MVS2008

Hi, being new to the Borland c++ builderX and MVS2008 IDEs, I would like to understand the proper way to add files to a project. Suppose if I have a created a project, add a C file say test1.c, compile and run it and get the desired results. Now if I would like to create another similar file test2.c which is similar to test1.c except for...

What is the maximum file size 32 bit java can access?

What is the maximum file size 32 bit java can access? Is this architecture dependent? ...

Java compiler error: "cannot find symbol" when trying to access local variable

$ javac GetAllDirs.java GetAllDirs.java:16: cannot find symbol symbol : variable checkFile location: class GetAllDirs System.out.println(checkFile.getName()); ^ 1 error $ cat GetAllDirs.java import java.util.*; import java.io.*; public class GetAllDirs { public void getAllDirs(File file) { ...

Opening a file in Mac OS X

I am trying to open a text file with C++ in Mac OS X but I always get a Bus error. I do not care where to put the file. I just need to read it. Am I writing its address wrong? or that Bus Error has another reason? FILE *dic; dic = fopen("DICT","rb"); dic = fopen("./DICT","rb"); dic = fopen("~/DICT","rb"); dic = fopen("~//DICT","rb")...

Optimized way of getting the size of a response in Ruby?

I can do File.size(path) to get the size of a file in bytes. How do I get the size of an HTTP response without writing it to a tempfile? ...

MATLAB: Reading floating point numbers and strings from a file

I am using the following functions for writing and reading 4098 floating point numbers in MATLAB: Writing: fid = fopen(completepath, 'w'); fprintf(fid, '%1.30f\r\n', y) Reading: data = textread(completepath, '%f', 4098); where y contains 4098 numbers. I now want to write and read 3 strings at the end of this data. How do I read ...

trying to read a delimited text file from resources - but it wont run

I'm having a problem where instead of reading a text file from the location string, I changed it to read the text file from the resource location and it breaks my program. I've also used the insert snippet method to get most of this code, so it is safe to say I don't know what is going on. Could some one please help? 'reads the tex...

Archive tar files to a different location inperl

Hi, I am a newbee in Perl. I am reading a directory having some archive files and uncompressing the archive files one by one. Everything seems well however the files are getting uncompressed in the folder which has the main perl code module which is running the sub modules. I want the archive to be generated in the folder I specify. ...

Avoiding dispose of underlying stream

I'm attempting to mock some file operations. In the "real" object I have: StreamWriter createFile( string name ) { return new StreamWriter( Path.Combine( _outFolder, name ), false, Encoding.UTF8 ) ); } In the mock object I'd like to have: StreamWriter createFile( string name ) { var ms = new MemoryStream(); _files.Add( Path.Com...

Zend Framework: How to download file from mySql Blob field.

I am uploading files(any type) in MySql tables's blob field. Now I am able to get binary data from that field and when I print it, it shows binary data in firbug console. But I want to download that file as it was uploaded. How can I convert this binary data into orignal file? How to do it in zend? Thanks ...

batch file command to run jar file

I am created jar file.The jar file is an executable one.But how can i run the jar file from the out side,using created batch file.I want to know the batch file coding to run the jar file without mentioning class path. Or is there any way to do it? ...

PHP script to generate a file with random data of given name and size?

Does anyone know of one? I need to test some upload/download scripts and need some really large files generated. I was going to integrate the test utility with my debug script. ...

Help needed implementing a web based file management system with a file hierarchy system, help needed with logic on storing of fileLocation and folders

Hello i am trying to create a web application that will allow users to upload files online, i am using gwt while using hibernate for database communication, i am able to upload file to a server , and store them on the server. but what i want is to associate the files with a user. i want the user to be able to create folders and store ...