php-uv icon indicating copy to clipboard operation
php-uv copied to clipboard

Add uv_fs_read() $offset param allowing seeking on open handles

Open rdlowrey opened this issue 11 years ago • 5 comments

This PR modifies uv_fs_read() with a new long $offset parameter. This allows the same file handle to be reused for multiple reads. Previously the only way to access a section of a file that had already been read was to open a new handle.

Old:

uv_fs_read(resource $loop, zval $fd, long $length, callable $callback)

New:

uv_fs_read(resource $loop, zval $fd, long $offset, long $length, callable $callback)

This change represents a minor BC break for existing code using uv_fs_read().

rdlowrey avatar Nov 11 '14 15:11 rdlowrey

+1!

steverhoades avatar Nov 14 '14 02:11 steverhoades

LOL! Didn't notice that but your right, I agree - consistency in that regard makes sense.

steverhoades avatar Nov 23 '14 17:11 steverhoades

Hope you dont mind but I merged this PR into the libuv 1.0 WIP.

steverhoades avatar Nov 23 '14 18:11 steverhoades

Yeah that's no problem @steverhoades ...

Pinging @chobie to see if we can get this PR merged. I know he's busy ... I'm forced to ignore PRs for long periods sometimes because of other work too :)

rdlowrey avatar Nov 26 '14 00:11 rdlowrey

@chobie How do you feel about merging this?

joshdifabio avatar Jun 10 '15 11:06 joshdifabio