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" <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] > Homepage: www.sed.is <- New Homepage! > ------------------------------------------ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]