[−][src]Struct wdinfo::file_status::FileStatus

pub struct FileStatus { /* fields omitted */ }

Get file status, along with basic file operation

File status list:

Implementations

impl FileStatus[src]

pub fn get_status(path: &PathBuf) -> Result<FileStatus, &'static str>[src]

get file status

* timestamp uses format "%Y-%m-%d %H:%M:%S" for PostgreSQL

pub fn get_file_status_under_folder(
    path: &str,
    delimiter: &str,
    mntpoint: &str
) -> Result<String, &'static str>
[src]

get file status for all files under one folder

- Output is String, not FileStatus struct
  - each line with one file status
  - the delimiter for fields in one line can be modified
  - new line symbol and delimiter are used when import data into PostgreSQL
- argument path as string slide can be relative path from root path (executable file path)
- argument mntpoint is used to replace /mnt by //Ip_address for workstation independence
- The method walkdir::WalkDir is used for all sub folders

pub fn delete_file(path: &str) -> Result<(), &'static str>[src]

delete file

* ignore others like folder, link, etc.

pub fn copy_file(ori_path: &str, dest_path: &str) -> Result<(), &'static str>[src]

copy file

* Do not copy if destination file exist
* Create destination folder if not exist
* check destination file existence before calling this method to avoid error

Trait Implementations

impl Debug for FileStatus[src]

Auto Trait Implementations

impl RefUnwindSafe for FileStatus[src]

impl Send for FileStatus[src]

impl Sync for FileStatus[src]

impl Unpin for FileStatus[src]

impl UnwindSafe for FileStatus[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> DebugAny for T where
    T: Any + Debug, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> UnsafeAny for T where
    T: Any, 

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,