pub fn validate_filename(filename: &[u8]) -> Result<()>Expand description
Validate that filename is an acceptable external filename.
Checks, in order:
- Not empty.
- Not longer than
MAX_FILENAME_LEN. - No embedded NUL bytes.
- Not an absolute path (does not start with
/). - No
..path components.
Note that . components and empty components (from //) are permitted,
as the kernel will handle them safely.
ยงErrors
Returns Error::InvalidFilename or Error::FilenameTooLong on failure.