mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-07 14:39:56 +01:00
fixed not working seek in stream-wrapper, caused by sw interface uses true/false while fseek uses 0/-1
This commit is contained in:
parent
61b140328d
commit
3c88fadba0
@ -250,14 +250,14 @@ class filesystem_stream_wrapper implements iface_stream_wrapper
|
||||
* See fseek() for more information about these parameters.
|
||||
*
|
||||
* @param integer $offset
|
||||
* @param integer $whence SEEK_SET - Set position equal to offset bytes
|
||||
* SEEK_CUR - Set position to current location plus offset.
|
||||
* SEEK_END - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.)
|
||||
* @param integer $whence SEEK_SET - 0 - Set position equal to offset bytes
|
||||
* SEEK_CUR - 1 - Set position to current location plus offset.
|
||||
* SEEK_END - 2 - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.)
|
||||
* @return boolean TRUE if the position was updated, FALSE otherwise.
|
||||
*/
|
||||
function stream_seek ( $offset, $whence )
|
||||
{
|
||||
return fseek($this->opened_stream,$offset,$whence);
|
||||
return !fseek($this->opened_stream,$offset,$whence); // fseek returns 0 on success and -1 on failure
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -478,9 +478,9 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
|
||||
* See fseek() for more information about these parameters.
|
||||
*
|
||||
* @param integer $offset
|
||||
* @param integer $whence SEEK_SET - Set position equal to offset bytes
|
||||
* SEEK_CUR - Set position to current location plus offset.
|
||||
* SEEK_END - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.)
|
||||
* @param integer $whence SEEK_SET - 0 - Set position equal to offset bytes
|
||||
* SEEK_CUR - 1 - Set position to current location plus offset.
|
||||
* SEEK_END - 2 - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.)
|
||||
* @return boolean TRUE if the position was updated, FALSE otherwise.
|
||||
*/
|
||||
function stream_seek ( $offset, $whence )
|
||||
@ -489,7 +489,7 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
|
||||
|
||||
if (is_resource($this->opened_stream))
|
||||
{
|
||||
return fseek($this->opened_stream,$offset,$whence);
|
||||
return !fseek($this->opened_stream,$offset,$whence); // fseek returns 0 on success and -1 on failure
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -404,14 +404,14 @@ class vfs_stream_wrapper implements iface_stream_wrapper
|
||||
* See fseek() for more information about these parameters.
|
||||
*
|
||||
* @param integer $offset
|
||||
* @param integer $whence SEEK_SET - Set position equal to offset bytes
|
||||
* SEEK_CUR - Set position to current location plus offset.
|
||||
* SEEK_END - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.)
|
||||
* @param integer $whence SEEK_SET - 0 - Set position equal to offset bytes
|
||||
* SEEK_CUR - 1 - Set position to current location plus offset.
|
||||
* SEEK_END - 2 - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.)
|
||||
* @return boolean TRUE if the position was updated, FALSE otherwise.
|
||||
*/
|
||||
function stream_seek ( $offset, $whence )
|
||||
{
|
||||
return fseek($this->opened_stream,$offset,$whence);
|
||||
return !fseek($this->opened_stream,$offset,$whence); // fseek returns 0 on success and -1 on failure
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user