Full change over to ctypes
[yaffs2.git] / direct / python / README.txt
index a6706e1329ad3b780466ac657f9f0cec3853d708..4dc517170c21d3bbce5127bd7285554e9fe590f6 100644 (file)
@@ -15,13 +15,10 @@ $ python
 Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) 
 [GCC 4.3.3] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
->>> from ctypes import *
->>> cdll.LoadLibrary("./libyaffsfs.so")
-<CDLL './libyaffsfs.so', handle 9ed4178 at b7d418ac>
->>> y = CDLL("./libyaffsfs.so")
->>> y.yaffs_StartUp()
+>>> from yaffsfs import *
+>>> yaffs_StartUp()
 0
->>> y.yaffs_mount("/yaffs2")
+>>> yaffs_mount("/yaffs2")
 yaffs: Mounting /yaffs2
 yaffs: yaffs_GutsInitialise()
 yaffs_ScanBackwards starts  intstartblk 1 intendblk 256...
@@ -45,18 +42,16 @@ Dead 0 blocks
 yaffs: yaffs_GutsInitialise() done.
 
 0
->>> y.yaffs_open("/yaffs2/xx",66,0666)
+>>> yaffs_open("/yaffs2/xx",66,0666)
 yaffs: Tnodes added
 Allocated block 1, seq  4097, 255 left
 0
->>> y.yaffs_write(0,"abc",3)
-3
->>> y.yaffs_lseek(0,0,0)
-0
+>>> yaffs_write(0,"abcdefg",5)
+5
 >>> b = create_string_buffer("",100)
->>> y.yaffs_read(0,b,100)
-3
->>> b.value
-'abc'
->>> 
-
+>>> yaffs_lseek(0,0,0)
+0
+>>> yaffs_read(0,b,100)
+5
+>>> print b.value
+abcde