projects
/
yaffs2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
22e75ce
)
More python example stuff
author
charles
<charles>
Tue, 13 Oct 2009 03:20:05 +0000
(
03:20
+0000)
committer
charles
<charles>
Tue, 13 Oct 2009 03:20:05 +0000
(
03:20
+0000)
direct/python/examples.py
patch
|
blob
|
history
diff --git
a/direct/python/examples.py
b/direct/python/examples.py
index 6b40080432ea237122d392da1f2216c4a1b6d580..ac2c48c3a911d95c29a9cd6d963f4b1a8177b2e1 100644
(file)
--- a/
direct/python/examples.py
+++ b/
direct/python/examples.py
@@
-22,10
+22,28
@@
def yaffs_ls(dname):
yaffs_ls(fullname)
sep = yaffs_readdir(dc)
yaffs_ls(fullname)
sep = yaffs_readdir(dc)
+ yaffs_closedir(dc)
+ return 0
else:
print "Could not open directory"
return -1
else:
print "Could not open directory"
return -1
+def yaffs_mkfile(fname,fsize):
+ fd = yaffs_open(fname,66, 0666)
+ if fd >= 0:
+ b = create_string_buffer("",1024)
+ totalwrite=0
+ while fsize > 0:
+ thiswrite = 1024 if fsize > 1024 else fsize
+ result = yaffs_write(fd,b,thiswrite)
+ totalwrite += result
+ fsize -= result
+ if result != thiswrite:
+ fsize= 0
+
+ return totalwrite
+ else :
+ return -1
root = "/yaffs2"
root = "/yaffs2"