pub struct FileSystem<S>{ /* private fields */ }Expand description
An API to process a FAT filesystem
Implementations§
Source§impl<S> FileSystem<S>
Getter functions
impl<S> FileSystem<S>
Getter functions
Source§impl<S> FileSystem<S>
Setter functions
impl<S> FileSystem<S>
Setter functions
Whether or not to list hidden files
Off by default
Sourcepub fn show_system(&self, show: bool)
pub fn show_system(&self, show: bool)
Whether or not to list system files
Off by default
Source§impl<S> FileSystem<S>
Constructors for a FileSystem
impl<S> FileSystem<S>
Constructors for a FileSystem
Source§impl<S> FileSystem<S>
Public Read-related functions
impl<S> FileSystem<S>
Public Read-related functions
Source§impl<S> FileSystem<S>
Write-related functions
impl<S> FileSystem<S>
Write-related functions
Sourcepub fn create_file<P: AsRef<Path>>(
&self,
path: P,
) -> FSResult<RWFile<'_, S>, S::Error>
pub fn create_file<P: AsRef<Path>>( &self, path: P, ) -> FSResult<RWFile<'_, S>, S::Error>
Create a new RWFile and return its handle
Sourcepub fn create_dir<P: AsRef<Path>>(&self, path: P) -> FSResult<(), S::Error>
pub fn create_dir<P: AsRef<Path>>(&self, path: P) -> FSResult<(), S::Error>
Create a new directory
Sourcepub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
from: P,
to: Q,
) -> FSResult<(), S::Error>
pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>( &self, from: P, to: Q, ) -> FSResult<(), S::Error>
Rename a file or directory to a new name
Sourcepub fn remove_file<P: AsRef<Path>>(&self, path: P) -> FSResult<(), S::Error>
pub fn remove_file<P: AsRef<Path>>(&self, path: P) -> FSResult<(), S::Error>
Remove a RWFile from the filesystem
This is an alias to self.get_rw_file(path)?.remove()?
Sourcepub fn remove_file_unchecked<P: AsRef<Path>>(
&self,
path: P,
) -> FSResult<(), S::Error>
pub fn remove_file_unchecked<P: AsRef<Path>>( &self, path: P, ) -> FSResult<(), S::Error>
Remove a file from the filesystem, even if it is read-only
USE WITH EXTREME CAUTION!
Sourcepub fn remove_empty_dir<P: AsRef<Path>>(
&self,
path: P,
) -> FSResult<(), S::Error>
pub fn remove_empty_dir<P: AsRef<Path>>( &self, path: P, ) -> FSResult<(), S::Error>
Remove an empty directory from the filesystem
Errors if the path provided points to the root directory
Sourcepub fn remove_dir_all<P: AsRef<Path>>(&self, path: P) -> FSResult<(), S::Error>
pub fn remove_dir_all<P: AsRef<Path>>(&self, path: P) -> FSResult<(), S::Error>
Removes a directory at this path, after removing all its contents.
Use with caution!
This will fail if there is at least 1 (one) read-only file
in this directory or in any subdirectory. To avoid this behavior,
use remove_dir_all_unchecked()
Sourcepub fn remove_dir_all_unchecked<P: AsRef<Path>>(
&self,
path: P,
) -> FSResult<(), S::Error>
pub fn remove_dir_all_unchecked<P: AsRef<Path>>( &self, path: P, ) -> FSResult<(), S::Error>
Like remove_dir_all(),
but also removes read-only files.
USE WITH EXTREME CAUTION!
Sourcepub fn check_for_readonly_files<P: AsRef<Path>>(
&self,
path: P,
) -> FSResult<bool, S::Error>
pub fn check_for_readonly_files<P: AsRef<Path>>( &self, path: P, ) -> FSResult<bool, S::Error>
Check path recursively to see if there are any read-only files in it
If successful, the bool returned indicates
whether or not at least 1 (one) read-only file has been found