yaffs More debug for yaffs browser.
authorTimothy Manning <tfhmanning@gmail.com>
Thu, 7 Oct 2010 22:06:17 +0000 (11:06 +1300)
committerTimothy Manning <tfhmanning@gmail.com>
Thu, 7 Oct 2010 22:06:17 +0000 (11:06 +1300)
Signed-off-by: Timothy Manning <tfhmanning@gmail.com>
direct/python/yaffs_browser.py

index 1239fe2b56071d3a1d574daf94b059db769265d2..8f88b975b9293c7cf0794c7ef47411cb55defd13 100755 (executable)
@@ -5,12 +5,12 @@ from yaffsfs import *
 import ctypes
 
 yaffs_StartUp()
 import ctypes
 
 yaffs_StartUp()
-yaffs_mount("yaffs2/")
+yaffs_mount("/yaffs2/")
 root_window =tk.Tk()
 root_window.title("YAFFS Browser")
 mount_list_text_variable=tk.StringVar()
 
 root_window =tk.Tk()
 root_window.title("YAFFS Browser")
 mount_list_text_variable=tk.StringVar()
 
-mount_list_text_variable.set("yaffs2/")
+mount_list_text_variable.set("/yaffs2/")
 current_directory_dict={}
 open_windows_list=[]
 
 current_directory_dict={}
 open_windows_list=[]
 
@@ -69,14 +69,17 @@ class editor():
         self.yaffs_handle = yaffs_open(current_directory_dict[self.id]["path"],66,0666)
         length_of_file=yaffs_lseek(self.yaffs_handle, 0, 2) ##seeks to the end of the file
         yaffs_lseek(self.yaffs_handle, 0, 0)## returns the handle to the front of th file
         self.yaffs_handle = yaffs_open(current_directory_dict[self.id]["path"],66,0666)
         length_of_file=yaffs_lseek(self.yaffs_handle, 0, 2) ##seeks to the end of the file
         yaffs_lseek(self.yaffs_handle, 0, 0)## returns the handle to the front of th file
+        print "length of file to be opened:", length_of_file
         if isLink==True:
         if isLink==True:
-            self.file_contents=ctypes.create_string_buffer(100)
-            yaffs_readlink(self.file_path,self.file_contents,100)
+            print "opening symlink"
+            self.file_contents=ctypes.create_string_buffer(1000)
+            yaffs_readlink(self.file_path,self.file_contents,1000)
             self.isLink=True
         else:
             self.isLink=True
         else:
+            print"opening file"
             self.file_contents=ctypes.create_string_buffer(length_of_file)
             yaffs_read(self.yaffs_handle,self.file_contents,length_of_file)
             self.file_contents=ctypes.create_string_buffer(length_of_file)
             yaffs_read(self.yaffs_handle,self.file_contents,length_of_file)
-        print "file contents", self.file_contents.raw
+            print "file contents", self.file_contents.raw
         self.file_editor_text.insert(tk.END, self.file_contents.raw)
         self.file_editor_text.pack()
         ##self.file_editor_text.bind("<Control-s>", self.save_file)
         self.file_editor_text.insert(tk.END, self.file_contents.raw)
         self.file_editor_text.pack()
         ##self.file_editor_text.bind("<Control-s>", self.save_file)