file

How to save file and read

Hello everyone, I create a program that place random image in grid layout format. The size of the grid layout is 6 x 6 = 36. Only 10 were filled with images (each image was different) and the rest were empty. How can I save it to a file and read it again, so it will display the same images with same placement on the grid? Here is th...

Adding file names to an array list in java

Hi I am currently needing to load the contents of a folders filenames to an arraylist I have but I am unsure as how to do this. To put it into perspective I have a folder with One.txt, Two.txt, Three.txt etc. I want to be able to load this list into an arraylist so that if I was to check the arraylist its contents would be : arraylist...

How to find the current line position of file pointer in C?

How can I get the current line position of the file pointer? ...

save input from text file to array

How to save text file content to different arrays? my text file content is like this; 12 14 16 18 13 17 14 18 10 23 pic1 pic2 pic3 pic4 pic5 pic6 pic7 pic8 pic9 pic10 left right top left right right top top left right 100 200 300 400 500 600 700 800 900 1000 how can I save each line into different array? e.g. line 1 will be saved in...

how to search a string in pdf content (C#) ?

I have two emergency questions ! 1- how to search a string in pdf file (in c#) ? 2- how to insert custom user control (C# controls) to pdf file ? ...

ObjectiveC builtin template system ?

I am developing an iPhone application and I use HTML to display formatted text. I often display the same webpage, but with a different content. I would like to use a template HTML file, and then fill it with my diffent values. I wonder if ObjectiveC has a template system similar to ERB in Ruby. That would allow to do things like Temp...

FileNotFound exception when trying to write to a file

OK, I'm feeling like this should be easy but am obviously missing something fundamental to file writing in Java. I have this: File someFile = new File("someDirA/someDirB/someDirC/filename.txt"); and I just want to write to the file. However, while someDirA exists, someDirB (and therefore someDirC and filename.txt) do not exist. Doi...

.NET Best Way to move many files to and from various directories??

I've created a program that moves files to and from various directories. An issue I've come across is when you're trying to move a file and some other program is still using it. And you get an error. Leaving it there isn't an option, so I can only think of having to keep trying to move it over and over again. This though slows the en...

iPhone: save log files and transfer to PC

Hi, In my iPhone application, there is a requirement to save a few log files in the phone(files are run-time generated). Then I have to copy/transfer the files into the pc. Can anyone suggest the best way to do this. Pls consider this as a newbee question. Thanks in advance.. ~Dhanesh ...

file upload in ajax by using php

hi.... I wud like to use file upload(ajax/javascript with php) in my form that has other controls also. when i uploaded an img it displays on the same form with delete option. if i click on submit it goes into folder as well as database & if i click on delete it deletes an img.... anybody can help me?pls u knw gmail file upload exact li...

How to work with file and streams in php

I have two class, one is Business Logic Class{BLO} and the other one is Data Access Class{DAO} and I have dependency in my BLO class to my Dao class. Basically am opening a csv file to write into it in my BLO class using inside its constructor as I am creating an object of BLO and passing in file from command prompt: Code: $this->fin...

How to update the filename of a Django's FileField instance ?

Hello, Here a simple django model: class SomeModel(models.Model): title = models.CharField(max_length=100) video = models.FileField(upload_to='video') I would like to save any instance so that the video's file name would be a valid file name of the title. For example, in the admin interface, I load a new instance with title ...

Native JDK code to copy files

Is there a native JDK code to copy files(buffers, streams, or whatever)? ...

find file name from full file path in R

Hi, I wondering if there is a quick way to extract the file name from the file full path in R (part of a file path) without the hassle of manipulating string? The equivalent in Java would be: File f = new File ("C:/some_dir/a") f.getName() //output a f.getFullAbsolutePath() //output c:/some_dir/a Thanks, Derek ...

reading xml file inside a jar-package

Here's my structure: com/mycompany/ValueReader.class com/mycompany/resources/values.xml I can read the file in my Eclipse project, but when I export it to a .jar it can never find the values.xml. I tried using ValueReader.class.getResource() and ValueReader.class.getResourceAsStream() but it doesn't work. What's the problem here? H...

Max file size for File.ReadAllLines

Hi, I need to read and process a text file. My processing would be easier if I could use the File.ReadAllLines method but I'm not sure what is the maximum size of the file that could be read with this method without reading by chunks. I understand that the file size depends on the computer memory. But are still there any recommendations ...

Interface for reading variable length files with header and footer.

I could use some hints or tips for a decent interface for reading file of special characteristics. The files in question has a header (~120 bytes), a body (1 byte - 3gb) and a footer (4 bytes). The header contains information about the body and the footer is only a simple CRC32-value of the body. I use Java so my idea was to extend th...

How to retrieve video thumbnail from an absolute path?

Hi everyone, I know this has to be trivial but I just don't find the right resource, I guess. So all I want to do is retrieving a thumbnail for a video. All I have is the absolute path to the file on the sdcard as a String. So please point me into the right direction. And believe me, this is embarrassing enough to ask... Regards, Stef...

Reading data from text file in C

I have a text file which contains words separated by space. I want to take each word from the file and store it. So i have opened the file but am unsure how to assign the word to a char. FILE *fp; fp = fopen("file.txt", "r"); //then i want char one = the first word in the file char two = the second word in the file ...

Segmentation fault

#include<stdio.h> #include<zlib.h> #include<unistd.h> #include<string.h> int main(int argc, char *argv[]) { char *path=NULL; size_t size; int index ; printf("\nArgument count is = %d", argc); printf ("\nThe 0th argument to the file is %s", argv[0]); path = getcwd(path, size); printf("\nThe current working directory...