X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Fpython%2Fexamples.py;h=6b0c04572f4695b027355c77efdc960352901dfb;hp=6500653884570dde7b2795ecacb0d1f986ea441a;hb=a013d252972520ff54a3124adc66ca52528aa652;hpb=77179ba56322261acd43fd0543b88dc455df7cda diff --git a/direct/python/examples.py b/direct/python/examples.py index 6500653..6b0c045 100644 --- 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" @@ -66,6 +78,8 @@ yaffs_mount(root) yaffs_mkdir(root+"/dd",0666) -yaffs_open(root+"/dd/111",66,0666) +h = yaffs_open(root+"/dd/111",66,0666) +yaffs_close(h) yaffs_ls(root) +