chobie / php-uv

libuv php extension
184 stars 21 forks source link

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

Open rdlowrey opened 9 years ago

rdlowrey commented 9 years ago

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().

steverhoades commented 9 years ago

+1!

steverhoades commented 9 years ago

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

steverhoades commented 9 years ago

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

rdlowrey commented 9 years ago

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 :)

joshdifabio commented 9 years ago

@chobie How do you feel about merging this?