open Unix
  let seekable fd =
    try let _ = lseek fd 0 SEEK_CUR in true
    with Unix_error (ESPIPE__) -> false