ID:               24162
 Updated by:       [EMAIL PROTECTED]
-Summary:          ftruncate wrong return value
 Reported By:      marcus at gooseflesh dot de
-Status:           Bogus
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: Windows 2000
 PHP Version:      4.3.2
 New Comment:

I went through every reference/filesystem function and appropriately
changed the following from int to bool:

chgrp.xml chmod.xml chown.xml copy.xml link.xml mkdir.xml rewind.xml
rmdir.xml symlink.xml touch.xml unlink.xml

They will show up during the next manual build, thanks for the report!
:)


Previous Comments:
------------------------------------------------------------------------

[2003-06-12 20:05:55] [EMAIL PROTECTED]

It returns bool and is documented as such, thanks for the report.

------------------------------------------------------------------------

[2003-06-12 17:32:58] marcus at gooseflesh dot de

Description:
------------
Hello folks,

Of some reasons the return value of ftruncate($handle, $size) is of
type int not of type bool. 

Is there a general reason that the half of the file functions return
true and false as int and the other half true and false as bool ???

Marcus Wilhelm

PHP is the best :))

Reproduce code:
---------------
$handle = fopen("existing.file", "r+");

$return = ftruncate($handle, 17);

if ( $return === true ) // does not match
{
    echo "truncate ok, return value is bool"; 
}
if ( $return == true ) // does match
{
    echo "truncate ok, return value is bool or int"; 
}
if ( $return == 1 ) // does match
{
    echo "truncate ok, return value is int"; 
}

Expected result:
----------------
the return value of ftruncate should be of type bool not of type int.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24162&edit=1


-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to