public override Buf mmap(string mode, long pos, Long size)
{
try
{
// map mode
/*
MmapBuf.FileRights mode;
if (mode.val.equals("r")) { mode = MmapBuff.FileRights.Read; }
else if (mode.val.equals("rw")) { mode = MmapBuff.FileRights.ReadWrite; }
else if (mode.val.equals("p")) throw ArgErr.make("Private mode not supported.").val;
else throw ArgErr.make("Invalid mode: " + mode).val;
// verify mode is 'r' or 'rw'
if (mode.val.equals("p")) throw ArgErr.make("Private mode not supported.").val;
if (!mode.val.equals("r") || !mode.val.equals("rw")) throw ArgErr.make("Invalid mode: " + mode).val;
// if size is null, use file size
if (size == null) size = size();
// traverse the various Java APIs
//RandomAccessFile fp = new RandomAccessFile(file, rw);
//FileChannel chan = fp.getChannel();
//MappedByteBuffer mmap = chan.map(mm, pos.val, size.val);
*/
return new MmapBuf(this, mode, pos, size);
}
catch (System.IO.IOException e)
{
throw IOErr.make(e).val;
}
}