Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 03-11-2004, 05:03 AM   #1 (permalink)
Nasimov
Registered User
 
Join Date: Mar 2004
Location: EarthPlanet
Posts: 2
Nasimov is on a distinguished road
Writing to a file. (PHP)

It's possible to ammend data within a file vs. just adding data to the beginning or the end of the file? Mean to change something in the "middle" of the file.
Thanks.
Nasimov is offline   Reply With Quote
Old 03-11-2004, 05:19 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,694
redhead is on a distinguished road
It's highly unlikely to be possible, the IO system won't know how to handle it.
You write to a file pointer, yet you expect the IO system to move the remaining bytes pointed at, automaticaly as you write to the current position.

I don't see how this can be handled by any system, without some form of temporarily storing the remaining data and then moving it back after finishing the adding.

If you're talking about changing data within the file itself, meaning overwriting already stored data, then use fopen(), fseek(), fwrite(), fclose() and you're done.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
need your help about writing data to file john_tran Standard C, C++ 9 10-20-2004 04:43 AM
csv file to mysql using php jayteema PHP 10 07-02-2004 11:20 AM
does PHP talk to JAVA class file?? Keith PHP 2 06-18-2004 08:23 AM


All times are GMT -8. The time now is 04:37 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting