--- php-5.0.1/main/streams/plain_wrapper.c 2004-07-31 13:00:10.000000000 +0200 +++ php-5.0.1-patch/main/streams/plain_wrapper.c 2004-08-26 01:03:53.328106456 +0200 @@ -732,6 +732,7 @@ return fd == -1 ? PHP_STREAM_OPTION_RETURN_ERR : PHP_STREAM_OPTION_RETURN_OK; case PHP_STREAM_TRUNCATE_SET_SIZE: + stream->position = *(size_t*) ptrparam; return ftruncate(fd, *(size_t*)ptrparam) == 0 ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR; }