[−][src]Struct wdinfo::file_status::FileStatus
Get file status, along with basic file operation
File status list:
- folder (dir name of the file, not include file name)
- file name
- isdir (bool)
- type (just file extension)
- file size
- timestamp for modifying
- timestamp for accessing
- timestamp for creating
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]
path: &str,
delimiter: &str,
mntpoint: &str
) -> Result<String, &'static str>
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DebugAny for T where
T: Any + Debug,
T: Any + Debug,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,