X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Fpython%2Fexamples.py;h=0f42c17ab812586003d42b53ed5397a8c16b6741;hp=11e5b8b209c3cd006a569c2991ac511dc61e6dde;hb=41573908f821bcb40750e7c069ea8f5178f630e5;hpb=3ac134099c4585aec7c1a166ccc389711b0dfaab diff --git a/direct/python/examples.py b/direct/python/examples.py index 11e5b8b..0f42c17 100644 --- a/direct/python/examples.py +++ b/direct/python/examples.py @@ -58,10 +58,22 @@ 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" -yaffs_StartUp() +yaffs_start_up() yaffs_mount(root) yaffs_mkdir(root+"/dd",0666)