file

How create file in C++ in a specific place in the PC

Hey all, I have a problem, I don't know how to create a file in C++ in a specific place in the PC. For example a file (.txt) in C:\file.txt. Can anybody help me? Thank you :) ...

Incorporating text files in applications ?

Is there anyway I can incorporate a pretty large text file (about 700KBs) into the program itself, so I don't have to ship the text files together in the application directory ? This is the first time I'm trying to do something like this, and I have no idea where to start from. Help is greatly appreciated (: ...

How to display data from txt file in specific format

I have a text file input which contains data as below. How can I display data from the text file into specific format? Monday Jessy Walking 20 minutes Matthew Run 20 minutes Karen Jogging 40 minutes Jessica Run 12 minutes Tuesday Messia Walking 10 minutes Matthew Run 20 minutes Pete Run 10 minutes Carol Walking 30 minutes I want to dis...

What is the best way to edit the middle of an existing flat file?

I have tool that creates variables for a simulation. The current workflow involves hand copying those variables into the simulation input file. The input file is a standard flat file, i.e. not binary or XML. I would like to automate the addition of the variables to the flat input file. The variables copy over existing variables in...

When i save a folder in a location, its getting stored in a folder above

I import a file, process it and save it in some location. I am saving my file in a folder but it is getting saved in a folder above the folder selected. Here is the code, private void btnSave_Click(object sender, EventArgs e) { FolderBrowserDialog saveFile = new FolderBrowserDialog(); saveFile.ShowNewFolderButton...

How delete folder in C++

Hey all, How delete folder using C++? I am something find at internet, but do not help me :( Can somebody help me? Thank you ...

How to save a Java FloatBuffer (or any Buffer) to a file

I have a FloatBuffer of known size and just want to dump the data to a file (in binary) for inspection outside my app. What's the easiest way to do this? ...

PHP write to file

Hi, below is some code I am using to "translate" a map array into SQL code so I can easily update my database when I have updated my game map. As you can see it prints out the SQL code onto the screen so I can copy and paste it. As my maps will get bigger this will become inefficient as it will crash the browser due to mass output, so i...

C# - Search Binary File for a Pattern

What is the best way to search a large binary file for a certain substring in C#? To provide some specifics, I'm trying to extract the DWARF information from an executable, so I only care about certain parts of the binary file (namely the sections starting with the strings .debug_info, .debug_abbrev, etc.) I don't see anything obvious ...

Storing data in txt file in specific format

Hi, my question is related to my previous question (How to display data from txt file in specific format). I was wondering if it is possible at the first place, to store data on txt file in specific format rather than store it first and then retreived it again and display it in specific format? e.g. instead of store data on txt file li...

python write string directly to tarfile

Is there a way to write a string directly to a tarfile? From http://docs.python.org/library/tarfile.html it looks like only files already written to the file system can be added. ...

How do I sort records in a text file using Java?

Some amendment of the data in txt file. I have tried the suggested code but Im not successfully write it again in the txt file with this format.I've tried the collection.sort but it write the data in long line. My txt file contain these data: Monday Jessica Run 20mins Alba Walk 20mins Amy Jogging 40mins Bobby Run...

Using mmap over a file

I'm trying to allow two different processes to communicate by using memory mapping the same file. However, I'm having some problems with this. I have a feeling this has to do with the way I'm using the open() call and passing my file descriptor to mmap. Here is my code, can you see anything wrong with it? Object 1's code: 16 FIL...

select random file from directory

I've seen a few examples but none so far in C#, what is the best way to select a random file under a directory? In this particular case I want to select a wallpaper from "C:\wallpapers" every 15 or so minutes. Thanks. ...

select random file from directory

Any suggestions on how to improve this method? I am currently using it to select a single wallpaper from a directory of wallpapers I know your not supposed to use arraylist anymore but i couldnt think of a altrnative also im not sure how to filter for more than just one type of file (ie jpg gif png) in the directory info. any suggestio...

How to programatically execute a CGI script form that contains a "file" type upload input field?

I've just written (in Perl) a simple web service that displays a web form containing a single "file" type upload field and a single Submit button. I made this simple web page with the intent that a human could use it and also that a script on a different machine could also execute it programatically. I got the human part all done and t...

C# .NET - How do I load a file into a DataSet?

I need to load a file (usually ASCII) into a DataSet. How can I do that? What data types should I use for my columns? Thanks. ...

How do you escape a file system path for the iPhone?

Hey everyone, Is there a system library for escaping a file system path for iPhone development? I have to read and write files where the file name is based on 3rd party values so I want to make sure the paths I'm actually writing to are nice and safe. I would have thought there was an NS library that would do this for me, since this is...

Is Fortran 77 POSIX conformant? - Write binary files

I'm trying to write binary data files from fortran, but I find the regular file interfaces very limiting, I wonder if Fortran has POSIX compilant functions. I found this standard: IEEE 1003.9-1992, but I don't know it if is fully supported by most common compilers (or if I have to activate any flags). I can't find any practical informat...

How can I direct log4j output so that different log levels go to different appenders?

Is it possible to have "debug" and "info" output written to the console while the "info" output is only written to some log file? For example, given this logging: LOG.debug(fileContent); LOG.info(fileLength); What does a corresponding log4j.xml look like? ...