Mercurial > yaffs-ecoscentric-gpl
changeset 434:69decb385a5c
yaffs: Add python test for O_EXCL
Check that OEXCL really works according to what's on the box.
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
| author | Charles Manning <cdhmanning@gmail.com> |
|---|---|
| date | Wed, 19 May 2010 12:46:51 +1200 |
| parents | 3a14788fde97 |
| children | 7a816fdf8f0f |
| files | direct/python/examples.py |
| diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/direct/python/examples.py +++ b/direct/python/examples.py @@ -58,6 +58,18 @@ def yaffs_link_test(dir): yaffs_ls(dir) yaffs_unlink(fnameb) +def yaffs_o_excl_test(dir): + fname = dir + '/aaa' + yaffs_unlink(fname) + fd = yaffs_open(fname, 66, 0666) + yaffs_close(fd) + print "Created ", fname, " result ", fd + fdx = yaffs_open(fname, 0301, 0666) + print "Attempt to create with O_EXCL existing file returned ", fdx + yaffs_unlink(fname) + fdx = yaffs_open(fname, 0301, 0666) + print "Attempt to create with O_EXCL non-existing file returned ", fdx + root = "/yaffs2"
