71adf506ce
Prior to this commit, uos.chdir('/') followed by uos.stat('noexist') would succeed that stat even though the entry did not exist (some other functions like listdir would have similar issues). This is because, if the current directory was the root and the path was relative, mp_vfs_lookup_path would return success for bad paths. Signed-off-by: Damien George <damien@micropython.org>
79 lines
1.0 KiB
Plaintext
79 lines
1.0 KiB
Plaintext
(16384, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
|
True
|
|
/
|
|
chdir x OSError
|
|
chdir /x OSError
|
|
listdir x OSError
|
|
listdir /x OSError
|
|
mkdir x OSError
|
|
mkdir /x OSError
|
|
remove x OSError
|
|
remove /x OSError
|
|
rmdir x OSError
|
|
rmdir /x OSError
|
|
stat x OSError
|
|
stat /x OSError
|
|
1 mount False False
|
|
['test_mnt']
|
|
('test_mnt', 16384, 0)
|
|
StopIteration
|
|
StopIteration
|
|
1 ilistdir /
|
|
['a1']
|
|
1 ilistdir /
|
|
['a1']
|
|
2 mount True False
|
|
['test_mnt', 'test_mnt2']
|
|
2 ilistdir /
|
|
['a2']
|
|
3 mount False False
|
|
OSError
|
|
OSError
|
|
OSError
|
|
1 chdir /
|
|
1 ilistdir
|
|
['a1']
|
|
1 getcwd
|
|
/test_mntdir1
|
|
1 mkdir test_dir
|
|
1 remove test_file
|
|
1 rename test_file test_file2
|
|
1 rmdir test_dir
|
|
1 stat test_file
|
|
(1,)
|
|
1 statvfs /
|
|
(1,)
|
|
1 open test_file r
|
|
1 open test_file wb
|
|
1 umount
|
|
2 umount
|
|
OSError
|
|
3 mount False False
|
|
(16384, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
|
3 statvfs /
|
|
(3,)
|
|
3 ilistdir /
|
|
['a3']
|
|
3 open test r
|
|
4 mount False False
|
|
3 ilistdir /
|
|
['mnt', 'a3']
|
|
4 ilistdir /
|
|
['a4']
|
|
4 chdir /
|
|
4 ilistdir
|
|
['a4']
|
|
3 chdir /subdir
|
|
3 ilistdir
|
|
['a3']
|
|
3 chdir /
|
|
3 umount
|
|
['mnt']
|
|
4 umount
|
|
OSError
|
|
/
|
|
5 mount False False
|
|
5 chdir /subdir
|
|
OSError
|
|
/
|