Re: What means "can't truncate sockets!"
| From: | Jaxon | Date: | Fri, 02 Mar 2001 01:15:10 +0000 |
| Subject: | Re: What means "can't truncate sockets!" | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-42263@lists.php.net to get a copy of this message | ||
well, because you are using "http://" PHP will have opened a
tcp/ip socket
:)
try using both fread() AND fclose()
from the manual:
http://www.php.net/manual/en/function.fread.php
// get contents of a file into a string
$filename = "/usr/local/something.txt";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
then truncate $contents
not sure, but should work...
regards,
jaxon
On 3/1/01 7:32 PM, "SED" <sed@sed.is> wrote:
> Hi,
>
> I'm trying to truncate a txt-file which I in my script use
> "http://mydomain/path/to/my/file.txt" as a reference
> but I get this error
> message:
>
> Warning: can't truncate sockets! in
> domains/mydomain/www/path/to/my/phpfile.php on line 47
>
> Does it mean I'll have to use "real" path e.g. c:\\domains\\mydomain...
> (etc.) or is it something else I should focus at? I'm working on a remote
> server (Linux/Apache) but this works 100% on my local server (Win2k/IIS5).
>
> Regards,
> Sumarlidi Einar Dadason
>
> SED - Graphic Design
>
> ------------------------------------------
> Phone: (+354) 4615501
> Mobile: (+354) 8960376
> Fax: (+354) 4615503
> E-mail: sed@sed.is
> Homepage: www.sed.is <- New Homepage!
> ------------------------------------------
>