phpbar.de logo

Mailinglisten-Archive

[php] Am Anfang eines Files schreiben

[php] Am Anfang eines Files schreiben

Kristian =?iso-8859-1?Q?K=F6hntopp?= kk_(at)_netuse.de
Wed, 25 Aug 1999 14:20:00 +0200


"Andreas.Kraftl" wrote:
> möchte eine Datei öffnen und am Anfang dieser einen Text schreiben.
> 
> Folgender Code funktioniert nicht, warum?

Du öffnest die Datei mit dem Modus "a" und das

$ man fopen
[ ... ]
    a or ab             Append; open or create file for writ-
                        ing at end-of-file.
[ ... ]
     Opening a file with append mode (a as the first character in
     the  mode argument) causes all subsequent writes to the file
     to be forced to the then current end-of-file, regardless  of
     intervening  calls  to  fseek(3S). If two separate processes
     open the same file for append, each process may write freely
     to  the file without fear of destroying output being written
     by the other.  The output from the  two  processes  will  be
     intermixed in the file in the order in which it is written.
[ ... ]

Kristian

-- 
Kristian Köhntopp, NetUSE Kommunikationstechnologie GmbH
Siemenswall, D-24107 Kiel, Germany, +49 431 386 436 00
Using PHP3? See our web development library at
http://phplib.shonline.de/ (GPL)


php::bar PHP Wiki   -   Listenarchive