X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Fpython%2Fexamples.py;h=6b0c04572f4695b027355c77efdc960352901dfb;hp=349e234453c8f0e7660e3cb17a039ebff136dadc;hb=29e2dccbc8145ce3fd337a91a266d29e9b0f3f60;hpb=f1b7e47fc0e0d58c0e4f6e298c0dd50b6f96370d;ds=sidebyside diff --git a/direct/python/examples.py b/direct/python/examples.py index 349e234..6b0c045 100644 --- a/direct/python/examples.py +++ b/direct/python/examples.py @@ -47,6 +47,30 @@ def yaffs_mkfile(fname,fsize): else : return -1 +def yaffs_link_test(dir): + fnamea = dir + '/aaa' + fnameb = dir + '/bbb' + yaffs_unlink(fnamea) + fd = yaffs_open(fnamea,66,0666) + yaffs_link(fnamea,fnameb) + yaffs_ls(dir) + yaffs_unlink(fnamea) + 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() @@ -54,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) +