On Sun, 23 Jan 2000, Stanislav Malyshev a.k.a Frodo wrote:
> VK>> чтения из файла записи вроде struct { int a; char b[8]; long c;
> VK>> short int d[6]};
>
> class struct {
> var $a;
> var $b;
> var $c;
> var $d;
>
> function struct() { // constructor
> $this->a=1;
> $this->b=range(1,8); // 8 integers
> $this->c=100000;
> $this->d=range(1,6); // 6 integers
> }
> }
>
> $foo = new struct();
>
> $fp = fopen("file","w");
> fputs($fp,serialize($foo));
> fclose($fp);
>
> $fp = fopen("file","r");
> $bar = unserialize(fgets($fp,4096));
> fclose($fp);
>
> var_dump($bar);
Ты не понял. Определять структуру файла тебе никто не даст. Она определена
другим приложением.
--
Artem Chuprina E-mail: ran@xxxxxxxxx
Netskate FIDO: 2:5020/371.32
Programmer Work phone: +7 (095) 290-9055
=============================================================================
= Apache-Talk@xxxxxxxxxxxxx mailing list =
Mail "unsubscribe apache-talk" to majordomo@xxxxxxxxxxxxx if you want to quit.
= Archive avaliable at http://www.lexa.ru/apache-talk =
"Russian Apache" includes software developed
by the Apache Group for use in the Apache HTTP server project
(http://www.apache.org/) See
Apache LICENSE.
Copyright (C) 1995-2001 The Apache Group. All rights reserved.
Copyright (C) 1996 Dm. Kryukov; Copyright (C)
1997-2009 Alex Tutubalin. Design (C) 1998 Max Smolev.