This commit stabilizes and deprecates library APIs whose FCP has closed in the
last cycle, specifically:
Stabilized APIs:
* `fs::canonicalize`
* `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists,
is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait.
* `Formatter::fill`
* `Formatter::width`
* `Formatter::precision`
* `Formatter::sign_plus`
* `Formatter::sign_minus`
* `Formatter::alternate`
* `Formatter::sign_aware_zero_pad`
* `string::ParseError`
* `Utf8Error::valid_up_to`
* `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}`
* `<[T]>::split_{first,last}{,_mut}`
* `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated
but will be once 1.5 is released.
* `str::{R,}MatchIndices`
* `str::{r,}match_indices`
* `char::from_u32_unchecked`
* `VecDeque::insert`
* `VecDeque::shrink_to_fit`
* `VecDeque::as_slices`
* `VecDeque::as_mut_slices`
* `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`)
* `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`)
* `Vec::resize`
* `str::slice_mut_unchecked`
* `FileTypeExt`
* `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}`
* `BinaryHeap::from` - `from_vec` deprecated in favor of this
* `BinaryHeap::into_vec` - plus a `Into` impl
* `BinaryHeap::into_sorted_vec`
Deprecated APIs
* `slice::ref_slice`
* `slice::mut_ref_slice`
* `iter::{range_inclusive, RangeInclusive}`
* `std::dynamic_lib`
Closes #27706
Closes #27725
cc #27726 (align not stabilized yet)
Closes #27734
Closes #27737
Closes #27742
Closes #27743
Closes #27772
Closes #27774
Closes #27777
Closes #27781
cc #27788 (a few remaining methods though)
Closes #27790
Closes #27793
Closes #27796
Closes #27810
cc #28147 (not all parts stabilized)
560 lines
16 KiB
Rust
560 lines
16 KiB
Rust
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
|
// file at the top-level directory of this distribution and at
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
// option. This file may not be copied, modified, or distributed
|
|
// except according to those terms.
|
|
|
|
use io::prelude::*;
|
|
use os::unix::prelude::*;
|
|
|
|
use ffi::{CString, CStr, OsString, OsStr};
|
|
use fmt;
|
|
use io::{self, Error, ErrorKind, SeekFrom};
|
|
use libc::{self, c_int, size_t, off_t, c_char, mode_t};
|
|
use mem;
|
|
use path::{Path, PathBuf};
|
|
use ptr;
|
|
use sync::Arc;
|
|
use sys::fd::FileDesc;
|
|
use sys::platform::raw;
|
|
use sys::{c, cvt, cvt_r};
|
|
use sys_common::{AsInner, FromInner};
|
|
use vec::Vec;
|
|
|
|
pub struct File(FileDesc);
|
|
|
|
#[derive(Clone)]
|
|
pub struct FileAttr {
|
|
stat: raw::stat,
|
|
}
|
|
|
|
pub struct ReadDir {
|
|
dirp: Dir,
|
|
root: Arc<PathBuf>,
|
|
}
|
|
|
|
struct Dir(*mut libc::DIR);
|
|
|
|
unsafe impl Send for Dir {}
|
|
unsafe impl Sync for Dir {}
|
|
|
|
pub struct DirEntry {
|
|
buf: Vec<u8>, // actually *mut libc::dirent_t
|
|
root: Arc<PathBuf>,
|
|
}
|
|
|
|
#[derive(Clone)]
|
|
pub struct OpenOptions {
|
|
flags: c_int,
|
|
read: bool,
|
|
write: bool,
|
|
mode: mode_t,
|
|
}
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug)]
|
|
pub struct FilePermissions { mode: mode_t }
|
|
|
|
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
|
|
pub struct FileType { mode: mode_t }
|
|
|
|
pub struct DirBuilder { mode: mode_t }
|
|
|
|
impl FileAttr {
|
|
pub fn size(&self) -> u64 { self.stat.st_size as u64 }
|
|
pub fn perm(&self) -> FilePermissions {
|
|
FilePermissions { mode: (self.stat.st_mode as mode_t) & 0o777 }
|
|
}
|
|
|
|
pub fn file_type(&self) -> FileType {
|
|
FileType { mode: self.stat.st_mode as mode_t }
|
|
}
|
|
}
|
|
|
|
impl AsInner<raw::stat> for FileAttr {
|
|
fn as_inner(&self) -> &raw::stat { &self.stat }
|
|
}
|
|
|
|
/// OS-specific extension methods for `fs::Metadata`
|
|
#[stable(feature = "metadata_ext", since = "1.1.0")]
|
|
pub trait MetadataExt {
|
|
/// Gain a reference to the underlying `stat` structure which contains the
|
|
/// raw information returned by the OS.
|
|
///
|
|
/// The contents of the returned `stat` are **not** consistent across Unix
|
|
/// platforms. The `os::unix::fs::MetadataExt` trait contains the cross-Unix
|
|
/// abstractions contained within the raw stat.
|
|
#[stable(feature = "metadata_ext", since = "1.1.0")]
|
|
fn as_raw_stat(&self) -> &raw::stat;
|
|
}
|
|
|
|
#[stable(feature = "metadata_ext", since = "1.1.0")]
|
|
impl MetadataExt for ::fs::Metadata {
|
|
fn as_raw_stat(&self) -> &raw::stat { &self.as_inner().stat }
|
|
}
|
|
|
|
impl FilePermissions {
|
|
pub fn readonly(&self) -> bool { self.mode & 0o222 == 0 }
|
|
pub fn set_readonly(&mut self, readonly: bool) {
|
|
if readonly {
|
|
self.mode &= !0o222;
|
|
} else {
|
|
self.mode |= 0o222;
|
|
}
|
|
}
|
|
pub fn mode(&self) -> raw::mode_t { self.mode }
|
|
}
|
|
|
|
impl FileType {
|
|
pub fn is_dir(&self) -> bool { self.is(libc::S_IFDIR) }
|
|
pub fn is_file(&self) -> bool { self.is(libc::S_IFREG) }
|
|
pub fn is_symlink(&self) -> bool { self.is(libc::S_IFLNK) }
|
|
|
|
pub fn is(&self, mode: mode_t) -> bool { self.mode & libc::S_IFMT == mode }
|
|
}
|
|
|
|
impl FromInner<raw::mode_t> for FilePermissions {
|
|
fn from_inner(mode: raw::mode_t) -> FilePermissions {
|
|
FilePermissions { mode: mode as mode_t }
|
|
}
|
|
}
|
|
|
|
impl Iterator for ReadDir {
|
|
type Item = io::Result<DirEntry>;
|
|
|
|
fn next(&mut self) -> Option<io::Result<DirEntry>> {
|
|
extern {
|
|
fn rust_dirent_t_size() -> c_int;
|
|
}
|
|
|
|
let mut buf: Vec<u8> = Vec::with_capacity(unsafe {
|
|
rust_dirent_t_size() as usize
|
|
});
|
|
let ptr = buf.as_mut_ptr() as *mut libc::dirent_t;
|
|
|
|
let mut entry_ptr = ptr::null_mut();
|
|
loop {
|
|
if unsafe { libc::readdir_r(self.dirp.0, ptr, &mut entry_ptr) != 0 } {
|
|
return Some(Err(Error::last_os_error()))
|
|
}
|
|
if entry_ptr.is_null() {
|
|
return None
|
|
}
|
|
|
|
let entry = DirEntry {
|
|
buf: buf,
|
|
root: self.root.clone()
|
|
};
|
|
if entry.name_bytes() == b"." || entry.name_bytes() == b".." {
|
|
buf = entry.buf;
|
|
} else {
|
|
return Some(Ok(entry))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
impl Drop for Dir {
|
|
fn drop(&mut self) {
|
|
let r = unsafe { libc::closedir(self.0) };
|
|
debug_assert_eq!(r, 0);
|
|
}
|
|
}
|
|
|
|
impl DirEntry {
|
|
pub fn path(&self) -> PathBuf {
|
|
self.root.join(<OsStr as OsStrExt>::from_bytes(self.name_bytes()))
|
|
}
|
|
|
|
pub fn file_name(&self) -> OsString {
|
|
OsStr::from_bytes(self.name_bytes()).to_os_string()
|
|
}
|
|
|
|
pub fn metadata(&self) -> io::Result<FileAttr> {
|
|
lstat(&self.path())
|
|
}
|
|
|
|
pub fn file_type(&self) -> io::Result<FileType> {
|
|
extern {
|
|
fn rust_dir_get_mode(ptr: *mut libc::dirent_t) -> c_int;
|
|
}
|
|
unsafe {
|
|
match rust_dir_get_mode(self.dirent()) {
|
|
-1 => lstat(&self.path()).map(|m| m.file_type()),
|
|
n => Ok(FileType { mode: n as mode_t }),
|
|
}
|
|
}
|
|
}
|
|
|
|
pub fn ino(&self) -> raw::ino_t {
|
|
extern {
|
|
fn rust_dir_get_ino(ptr: *mut libc::dirent_t) -> raw::ino_t;
|
|
}
|
|
unsafe { rust_dir_get_ino(self.dirent()) }
|
|
}
|
|
|
|
fn name_bytes(&self) -> &[u8] {
|
|
extern {
|
|
fn rust_list_dir_val(ptr: *mut libc::dirent_t) -> *const c_char;
|
|
}
|
|
unsafe {
|
|
CStr::from_ptr(rust_list_dir_val(self.dirent())).to_bytes()
|
|
}
|
|
}
|
|
|
|
fn dirent(&self) -> *mut libc::dirent_t {
|
|
self.buf.as_ptr() as *mut _
|
|
}
|
|
}
|
|
|
|
impl OpenOptions {
|
|
pub fn new() -> OpenOptions {
|
|
OpenOptions {
|
|
flags: libc::O_CLOEXEC,
|
|
read: false,
|
|
write: false,
|
|
mode: 0o666,
|
|
}
|
|
}
|
|
|
|
pub fn read(&mut self, read: bool) {
|
|
self.read = read;
|
|
}
|
|
|
|
pub fn write(&mut self, write: bool) {
|
|
self.write = write;
|
|
}
|
|
|
|
pub fn append(&mut self, append: bool) {
|
|
self.flag(libc::O_APPEND, append);
|
|
}
|
|
|
|
pub fn truncate(&mut self, truncate: bool) {
|
|
self.flag(libc::O_TRUNC, truncate);
|
|
}
|
|
|
|
pub fn create(&mut self, create: bool) {
|
|
self.flag(libc::O_CREAT, create);
|
|
}
|
|
|
|
pub fn mode(&mut self, mode: raw::mode_t) {
|
|
self.mode = mode as mode_t;
|
|
}
|
|
|
|
fn flag(&mut self, bit: c_int, on: bool) {
|
|
if on {
|
|
self.flags |= bit;
|
|
} else {
|
|
self.flags &= !bit;
|
|
}
|
|
}
|
|
}
|
|
|
|
impl File {
|
|
pub fn open(path: &Path, opts: &OpenOptions) -> io::Result<File> {
|
|
let path = try!(cstr(path));
|
|
File::open_c(&path, opts)
|
|
}
|
|
|
|
pub fn open_c(path: &CStr, opts: &OpenOptions) -> io::Result<File> {
|
|
let flags = opts.flags | match (opts.read, opts.write) {
|
|
(true, true) => libc::O_RDWR,
|
|
(false, true) => libc::O_WRONLY,
|
|
(true, false) |
|
|
(false, false) => libc::O_RDONLY,
|
|
};
|
|
let fd = try!(cvt_r(|| unsafe {
|
|
libc::open(path.as_ptr(), flags, opts.mode)
|
|
}));
|
|
let fd = FileDesc::new(fd);
|
|
// Even though we open with the O_CLOEXEC flag, still set CLOEXEC here,
|
|
// in case the open flag is not supported (it's just ignored by the OS
|
|
// in that case).
|
|
fd.set_cloexec();
|
|
Ok(File(fd))
|
|
}
|
|
|
|
pub fn file_attr(&self) -> io::Result<FileAttr> {
|
|
let mut stat: raw::stat = unsafe { mem::zeroed() };
|
|
try!(cvt(unsafe {
|
|
libc::fstat(self.0.raw(), &mut stat as *mut _ as *mut _)
|
|
}));
|
|
Ok(FileAttr { stat: stat })
|
|
}
|
|
|
|
pub fn fsync(&self) -> io::Result<()> {
|
|
try!(cvt_r(|| unsafe { libc::fsync(self.0.raw()) }));
|
|
Ok(())
|
|
}
|
|
|
|
pub fn datasync(&self) -> io::Result<()> {
|
|
try!(cvt_r(|| unsafe { os_datasync(self.0.raw()) }));
|
|
return Ok(());
|
|
|
|
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
|
unsafe fn os_datasync(fd: c_int) -> c_int {
|
|
libc::fcntl(fd, libc::F_FULLFSYNC)
|
|
}
|
|
#[cfg(target_os = "linux")]
|
|
unsafe fn os_datasync(fd: c_int) -> c_int { libc::fdatasync(fd) }
|
|
#[cfg(not(any(target_os = "macos",
|
|
target_os = "ios",
|
|
target_os = "linux")))]
|
|
unsafe fn os_datasync(fd: c_int) -> c_int { libc::fsync(fd) }
|
|
}
|
|
|
|
pub fn truncate(&self, size: u64) -> io::Result<()> {
|
|
try!(cvt_r(|| unsafe {
|
|
libc::ftruncate(self.0.raw(), size as libc::off_t)
|
|
}));
|
|
Ok(())
|
|
}
|
|
|
|
pub fn read(&self, buf: &mut [u8]) -> io::Result<usize> {
|
|
self.0.read(buf)
|
|
}
|
|
|
|
pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
|
|
self.0.write(buf)
|
|
}
|
|
|
|
pub fn flush(&self) -> io::Result<()> { Ok(()) }
|
|
|
|
pub fn seek(&self, pos: SeekFrom) -> io::Result<u64> {
|
|
let (whence, pos) = match pos {
|
|
SeekFrom::Start(off) => (libc::SEEK_SET, off as off_t),
|
|
SeekFrom::End(off) => (libc::SEEK_END, off as off_t),
|
|
SeekFrom::Current(off) => (libc::SEEK_CUR, off as off_t),
|
|
};
|
|
let n = try!(cvt(unsafe { libc::lseek(self.0.raw(), pos, whence) }));
|
|
Ok(n as u64)
|
|
}
|
|
|
|
pub fn fd(&self) -> &FileDesc { &self.0 }
|
|
|
|
pub fn into_fd(self) -> FileDesc { self.0 }
|
|
}
|
|
|
|
impl DirBuilder {
|
|
pub fn new() -> DirBuilder {
|
|
DirBuilder { mode: 0o777 }
|
|
}
|
|
|
|
pub fn mkdir(&self, p: &Path) -> io::Result<()> {
|
|
let p = try!(cstr(p));
|
|
try!(cvt(unsafe { libc::mkdir(p.as_ptr(), self.mode) }));
|
|
Ok(())
|
|
}
|
|
|
|
pub fn set_mode(&mut self, mode: mode_t) {
|
|
self.mode = mode;
|
|
}
|
|
}
|
|
|
|
fn cstr(path: &Path) -> io::Result<CString> {
|
|
path.as_os_str().to_cstring().ok_or(
|
|
io::Error::new(io::ErrorKind::InvalidInput, "path contained a null"))
|
|
}
|
|
|
|
impl FromInner<c_int> for File {
|
|
fn from_inner(fd: c_int) -> File {
|
|
File(FileDesc::new(fd))
|
|
}
|
|
}
|
|
|
|
impl fmt::Debug for File {
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
#[cfg(target_os = "linux")]
|
|
fn get_path(fd: c_int) -> Option<PathBuf> {
|
|
use string::ToString;
|
|
let mut p = PathBuf::from("/proc/self/fd");
|
|
p.push(&fd.to_string());
|
|
readlink(&p).ok()
|
|
}
|
|
|
|
#[cfg(target_os = "macos")]
|
|
fn get_path(fd: c_int) -> Option<PathBuf> {
|
|
// FIXME: The use of PATH_MAX is generally not encouraged, but it
|
|
// is inevitable in this case because OS X defines `fcntl` with
|
|
// `F_GETPATH` in terms of `MAXPATHLEN`, and there are no
|
|
// alternatives. If a better method is invented, it should be used
|
|
// instead.
|
|
let mut buf = vec![0;libc::PATH_MAX as usize];
|
|
let n = unsafe { libc::fcntl(fd, libc::F_GETPATH, buf.as_ptr()) };
|
|
if n == -1 {
|
|
return None;
|
|
}
|
|
let l = buf.iter().position(|&c| c == 0).unwrap();
|
|
buf.truncate(l as usize);
|
|
buf.shrink_to_fit();
|
|
Some(PathBuf::from(OsString::from_vec(buf)))
|
|
}
|
|
|
|
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
|
|
fn get_path(_fd: c_int) -> Option<PathBuf> {
|
|
// FIXME(#24570): implement this for other Unix platforms
|
|
None
|
|
}
|
|
|
|
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
|
fn get_mode(fd: c_int) -> Option<(bool, bool)> {
|
|
let mode = unsafe { libc::fcntl(fd, libc::F_GETFL) };
|
|
if mode == -1 {
|
|
return None;
|
|
}
|
|
match mode & libc::O_ACCMODE {
|
|
libc::O_RDONLY => Some((true, false)),
|
|
libc::O_RDWR => Some((true, true)),
|
|
libc::O_WRONLY => Some((false, true)),
|
|
_ => None
|
|
}
|
|
}
|
|
|
|
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
|
|
fn get_mode(_fd: c_int) -> Option<(bool, bool)> {
|
|
// FIXME(#24570): implement this for other Unix platforms
|
|
None
|
|
}
|
|
|
|
let fd = self.0.raw();
|
|
let mut b = f.debug_struct("File");
|
|
b.field("fd", &fd);
|
|
if let Some(path) = get_path(fd) {
|
|
b.field("path", &path);
|
|
}
|
|
if let Some((read, write)) = get_mode(fd) {
|
|
b.field("read", &read).field("write", &write);
|
|
}
|
|
b.finish()
|
|
}
|
|
}
|
|
|
|
pub fn readdir(p: &Path) -> io::Result<ReadDir> {
|
|
let root = Arc::new(p.to_path_buf());
|
|
let p = try!(cstr(p));
|
|
unsafe {
|
|
let ptr = libc::opendir(p.as_ptr());
|
|
if ptr.is_null() {
|
|
Err(Error::last_os_error())
|
|
} else {
|
|
Ok(ReadDir { dirp: Dir(ptr), root: root })
|
|
}
|
|
}
|
|
}
|
|
|
|
pub fn unlink(p: &Path) -> io::Result<()> {
|
|
let p = try!(cstr(p));
|
|
try!(cvt(unsafe { libc::unlink(p.as_ptr()) }));
|
|
Ok(())
|
|
}
|
|
|
|
pub fn rename(old: &Path, new: &Path) -> io::Result<()> {
|
|
let old = try!(cstr(old));
|
|
let new = try!(cstr(new));
|
|
try!(cvt(unsafe { libc::rename(old.as_ptr(), new.as_ptr()) }));
|
|
Ok(())
|
|
}
|
|
|
|
pub fn set_perm(p: &Path, perm: FilePermissions) -> io::Result<()> {
|
|
let p = try!(cstr(p));
|
|
try!(cvt_r(|| unsafe { libc::chmod(p.as_ptr(), perm.mode) }));
|
|
Ok(())
|
|
}
|
|
|
|
pub fn rmdir(p: &Path) -> io::Result<()> {
|
|
let p = try!(cstr(p));
|
|
try!(cvt(unsafe { libc::rmdir(p.as_ptr()) }));
|
|
Ok(())
|
|
}
|
|
|
|
pub fn readlink(p: &Path) -> io::Result<PathBuf> {
|
|
let c_path = try!(cstr(p));
|
|
let p = c_path.as_ptr();
|
|
|
|
let mut buf = Vec::with_capacity(256);
|
|
|
|
loop {
|
|
let buf_read = try!(cvt(unsafe {
|
|
libc::readlink(p, buf.as_mut_ptr() as *mut _, buf.capacity() as libc::size_t)
|
|
})) as usize;
|
|
|
|
unsafe { buf.set_len(buf_read); }
|
|
|
|
if buf_read != buf.capacity() {
|
|
buf.shrink_to_fit();
|
|
|
|
return Ok(PathBuf::from(OsString::from_vec(buf)));
|
|
}
|
|
|
|
// Trigger the internal buffer resizing logic of `Vec` by requiring
|
|
// more space than the current capacity. The length is guaranteed to be
|
|
// the same as the capacity due to the if statement above.
|
|
buf.reserve(1);
|
|
}
|
|
}
|
|
|
|
pub fn symlink(src: &Path, dst: &Path) -> io::Result<()> {
|
|
let src = try!(cstr(src));
|
|
let dst = try!(cstr(dst));
|
|
try!(cvt(unsafe { libc::symlink(src.as_ptr(), dst.as_ptr()) }));
|
|
Ok(())
|
|
}
|
|
|
|
pub fn link(src: &Path, dst: &Path) -> io::Result<()> {
|
|
let src = try!(cstr(src));
|
|
let dst = try!(cstr(dst));
|
|
try!(cvt(unsafe { libc::link(src.as_ptr(), dst.as_ptr()) }));
|
|
Ok(())
|
|
}
|
|
|
|
pub fn stat(p: &Path) -> io::Result<FileAttr> {
|
|
let p = try!(cstr(p));
|
|
let mut stat: raw::stat = unsafe { mem::zeroed() };
|
|
try!(cvt(unsafe {
|
|
libc::stat(p.as_ptr(), &mut stat as *mut _ as *mut _)
|
|
}));
|
|
Ok(FileAttr { stat: stat })
|
|
}
|
|
|
|
pub fn lstat(p: &Path) -> io::Result<FileAttr> {
|
|
let p = try!(cstr(p));
|
|
let mut stat: raw::stat = unsafe { mem::zeroed() };
|
|
try!(cvt(unsafe {
|
|
libc::lstat(p.as_ptr(), &mut stat as *mut _ as *mut _)
|
|
}));
|
|
Ok(FileAttr { stat: stat })
|
|
}
|
|
|
|
pub fn canonicalize(p: &Path) -> io::Result<PathBuf> {
|
|
let path = try!(CString::new(p.as_os_str().as_bytes()));
|
|
let buf;
|
|
unsafe {
|
|
let r = c::realpath(path.as_ptr(), ptr::null_mut());
|
|
if r.is_null() {
|
|
return Err(io::Error::last_os_error())
|
|
}
|
|
buf = CStr::from_ptr(r).to_bytes().to_vec();
|
|
libc::free(r as *mut _);
|
|
}
|
|
Ok(PathBuf::from(OsString::from_vec(buf)))
|
|
}
|
|
|
|
pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
|
|
use fs::{File, set_permissions};
|
|
if !from.is_file() {
|
|
return Err(Error::new(ErrorKind::InvalidInput,
|
|
"the source path is not an existing regular file"))
|
|
}
|
|
|
|
let mut reader = try!(File::open(from));
|
|
let mut writer = try!(File::create(to));
|
|
let perm = try!(reader.metadata()).permissions();
|
|
|
|
let ret = try!(io::copy(&mut reader, &mut writer));
|
|
try!(set_permissions(to, perm));
|
|
Ok(ret)
|
|
}
|