X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=direct%2Fpython%2Fexamples.py;h=11e5b8b209c3cd006a569c2991ac511dc61e6dde;hb=f37d0b9ff0c87c1e22a5f708dbb4b455da7af59f;hp=ac2c48c3a911d95c29a9cd6d963f4b1a8177b2e1;hpb=58e2f3b9748ed3595ebdec6bdf3db2399ad18dcf;p=yaffs2.git diff --git a/direct/python/examples.py b/direct/python/examples.py index ac2c48c..11e5b8b 100644 --- a/direct/python/examples.py +++ b/direct/python/examples.py @@ -17,10 +17,12 @@ def yaffs_ls(dname): if isFile : print "File ",se.d_ino, hex(perms), st.st_size, fullname - if isDir : + elif isDir : print "Dir ",se.d_ino, hex(perms), fullname yaffs_ls(fullname) - + else : + print "Other (",hex(st.st_mode),") ",se.d_ino, hex(perms), fullname + sep = yaffs_readdir(dc) yaffs_closedir(dc) return 0 @@ -45,6 +47,18 @@ 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) + + root = "/yaffs2" yaffs_StartUp() @@ -52,6 +66,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) +