blob: c333d3d45c0bf8257a71f993dbf970344fcf4d4f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
use io;
// Reads from a stream into a buffer at specified offset
fn pread(s: io::handle, buf: []u8, off: io::off) (size | io::EOF | io::error) = {
io::seek(s, off, io::whence::SET)?;
return io::read(s, buf)?;
};
// Writes into a stream from a buffer at specified offset
fn pwrite(s: io::handle, buf: const []u8, off: io::off) (size | io::error) = {
io::seek(s, off, io::whence::SET)?;
return io::write(s, buf)?;
};
|