file

Why am I getting an ferror on my source file using zlib deflate?

EDIT // open output file for writing if ( ( outfilefd = fopen( file_name, "w+t" ) ) == NULL ) { fprintf(stderr, "Unable to create file\n"); exit(1); } Write to the file, then need to zip it. Opening a .z file and then calling def() FILE *zipFile; if ( ( zipFile = fopen( "C:\\LOGS\\test.txt.z", "w+t" ) ...

Encrypting streaming content onto persistent storage and decrypting it to the stream on iPhone

Hello fellow developers, My app "streams" content (fixed sized files, hence quotation marks) from an HTTP server into a local file. Then there is another component of the app that opens that same file and displays it (plays it). This is done for caching purposes, so that when the same file is requested next time, it will no longer need...

Append item to a file before last line in c

The footer should update with current time and hour when a new Item added to the file. Here is the sample file format, ITEM1 ITEM2 06/07/2010 10:20:22 //footer line The “item” has to append in the existing file, prior to the footer line, and the footer should be updated with new value. I am having to variables, “item” and “time” which ...

How can i open binary files (exe) in "Delphi" , like Visual basic ?!

Hi , in visual basic i can open a binary(exe) file with below way : Strx$ = Space(FileLen(FileName)) Open FileName For Binary As #1 Get #1, , Strx$ Close in this way i can read all of binary file characters and read file content like this format : and the question is how can i open a binary(exe) file in delphi with a string format...

use of upload class in codeigniter - Model or Controller ?

Hi, Quick question about CI. I have a view with a form, several text input fields and a file upload. I want to be able to take the input from the text fields, save it to the DB, and then upload the image. I've achieved this by having the upload code in a controller, and if the upload is successful, a call to my Model is made to update...

Monitoring a large log file in C#

I have to monitor a large log file during the day with C#. The size goes up to 200-300 MB for a day. What is the most efficient way to analyze it? The file is locked by the producing program. Preferably I would either have a read which realises that lines have been added or would read backwards. ...

how to test file server plugin on Symbian emulator?

I am developing a simple file server plugin that intercepts requests. I want to test it. Because of the TCB capabilities I can't put it on a real device. How can I test it on Symbian^3 emulator? I am new to platform developments. I need help. ...

Appending a data to file in c

I require to add a string before 45byte in an existing file. I tried using fseek as bellow. int main() { FILE *fp; char str[] = "test"; fp = fopen(FILEPATH,"a"); fseek(fp,-45, SEEK_END); fprintf(fp,"%s",str); fclose(fp); return(0); } I expected that this code will add "test" in before 45 char from EOF...

C stat() and daylight savings

I'm having serious trouble with the function stat(). I have an application compiled under cygwin ond Windows 7 and the same app compiled with MSVC++ on Windows 7. The app contains the following code: struct stat stb; memset( &stb, 0, sizeof( stb ) ); stat( szPath, &stb ); cout << hex << uppercase << setw(8) << stb.st_mtime << endl; ...

C# get file location from client-side

I need user to select file on his computer and get only location of that file (not to upload). Any suggestions? Thanks, Ile ...

Executing Application inside an archive file without extraction

I want to compress and encrypt my whole application, maybe with Zip, 7z, Bz2, Tar, or any compression method, and using AES-128/256 as encryption algorithm for security purposes. Then create a launcher application which will handle the execution of the application and decryption of the archive. I already have an idea on how to achieve i...

(JAVA) How open a temp htm file in browser?

I tried this, but without sucess: File temp = File.createTempFile("document", ".htm"); BufferedWriter out = new BufferedWriter(new FileWriter(temp)); out.write("hi !!!"); out.close(); System.out.println(temp.toURI().toString()); java.awt.Desktop.getDesktop().browse(temp.toURI())...

How to provide access to an external resource (file) for a GlassFish web application?

I am a bit of a GlassFish beginner, so please forgive my ingnorance on the subject. Basically we are serving a game website, and to make the client downloadable by our web app we copy it into a directory within domain1. The problem with this is that when redeploying the web app the client downloadable is lost and we have to copy it acro...

How do I open a transacted file in C#

I understand W7 support transacted files. How do I use them in C#? ...

Overwrite file using append mode for fopen

I am using fopen to write to a binary file and using the cstdio (stdio.h) library due to legacy code and it must be cross-platform compatible with Windows and Linux. For the prototype, FILE * fopen ( const char * filename, const char * mode );, I am using const char * mode = "ab", which will append to a binary file. Writing operations ...

html input button style CSS3

I saw some results via the related questions but didn't actually seem to show what I want. Looking for a way to simply style the button in all major broswers easily. <input type="file" name="file" id="file" size="29" class="formButton" /> <span class="smalltext">(.txt only)</span> I want the browse button to use the CSS, I have seen...

(iPhone) Reading from a web file - NSMutableArray

Right now I have an NSArray whose items are just written in the implementation file. I'd like to know how to make it so I can store all the items on a web (text) file. Example: http://mysite.com/files/objects.txt On that document: Object 0 goes here Object 1 goes here Object 2 goes here Object 3 goes here etc. All separated by ...

How do/should I prepare a folder for stored image, reference from sql, save the image location using C#

Really hoping someone can provide some code sample or point me in the right direction (with examples C#.net). I did try to check if this question was asked before.. but didn't really find code samples which answered all my questions. Image folder for saved files -should this be in the solution or somewhere else What kind of data type -...

Is there a need for file descriptor control program/syscall ?

I am currently thinking of implementing a syscall in some BSD flavours in order to close a given file descriptor. The file descriptor would be defined as a pair of PID and file descriptor number. It will be useful in order to test/debug a program or others strange purposes. I think that I will do it anyway, you know, for learning purpo...

Override file icon in windows shell/explorer

Is there a way to override the icon and/or preview of a specific file format (my own) in Windows Explorer using C#? My files are xml files that contain a base-64 image, I'd like to display this image in Explorer as the file icon. ...