Include some convenient methods to extend IO operation.
More...
|
static string[] | GetDeepFiles (params string[] paths) |
| Filter to get the paths of all files and files in directories except "*.meta". More...
|
|
static void | Delete (string path, bool ancestor=false) |
| Try to delete a file or directory at the specified path. More...
|
|
static bool | CheckCreatable (string path, bool exception=false) |
| Determine if the path can be used to create a file or directory. More...
|
|
Include some convenient methods to extend IO operation.
3
static string [] GetDeepFiles |
( |
params string[] |
paths | ) |
|
|
static |
Filter to get the paths of all files and files in directories except "*.meta".
- Parameters
-
- Returns
- The file paths.
static void Delete |
( |
string |
path, |
|
|
bool |
ancestor = false |
|
) |
| |
|
static |
Try to delete a file or directory at the specified path.
This doesn't work in Web Player. Note, the operation is permanently and irreversibly. Optional to trace and delete ancestor directories if became empty.
- Parameters
-
path | Path. |
ancestor | If set to true delete ancestor directories if empty. |
static bool CheckCreatable |
( |
string |
path, |
|
|
bool |
exception = false |
|
) |
| |
|
static |
Determine if the path can be used to create a file or directory.
A legal path might not be in good format, e.g., "C:dir\ //file" or "/\pc\share\\new.txt". But it's safe to pass to Directory
or FileInfo
to create.
Path in situations below is invalid, even dangerous:
- Nothing but empty or white-spaces, nowhere to go.
- Starts with 3 slashes, this causes crash while system looking for parent directories.
- Includes invalid chars, can't name a file.
- A name in path starts or ends with space, we can't get the created file, even delete.
- Parameters
-
path | Path. |
exception | If invalid, throw an exception or return false . |
- Returns
true
if is creatable; otherwise, false
.