9 print "youloaded a file"
10 def back_a_directory(self=0):
14 if dname[-1] != "/": dname = dname + "/"
15 dc = yaffs_opendir(dname)
17 sep = yaffs_readdir(dc)
20 fullname = dname + se.d_name
21 #print fullname, " ", se.d_ino," ",ord(se.d_type)
22 st = yaffs_stat_struct()
23 result = yaffs_stat(fullname,byref(st))
24 perms = st.st_mode & 0777
25 isFile = True if st.st_mode & 0x8000 else False
26 isDir = True if st.st_mode & 0x4000 else False
29 print "File ",se.d_ino, hex(perms), st.st_size, fullname
31 print "Dir ",se.d_ino, hex(perms), fullname
34 print "Other (",hex(st.st_mode),") ",se.d_ino, hex(perms), fullname
36 sep = yaffs_readdir(dc)
40 print "Could not open directory"
46 toolbar_frame=tk.Frame(root_window)
47 button_open=tk.Button(toolbar_frame, command=load_file, text="load")
48 button_open.grid(column=0, row=0)
49 button_back=tk.Button(toolbar_frame, command=back_a_directory, text="back")
50 button_back.grid(column=1, row=0)
51 toolbar_frame.grid(row=0, column=0, columnspan=3)
52 #root_window.bind("<Double-Button-1>", button_open)
56 ##mount list entry box init
57 mount_list_frame=tk.Frame(root_window)
58 mount_list_label=tk.Label(mount_list_frame, text="mount list")
59 mount_list_label.pack(side=tk.RIGHT)
60 mount_list_text_variable=tk.StringVar()
62 mount_list_text_variable.set("path")
63 mount_list_entry_box= tk.Entry(mount_list_frame,textvariable=mount_list_text_variable)
64 mount_list_entry_box.pack(side=tk.RIGHT)
65 mount_list_frame.grid(row=1, column=0, columnspan=2)
70 list_frame=tk.Frame(root_window)
72 ###header part of the browser
74 #name_button=tk.Button(list_frame, text="name")
75 #name_button.grid(row=0, column=0)
77 #type_button=tk.Button(list_frame, text="file type")
78 #type_button.grid(row=0, column=1)
80 #size_button=tk.Button(list_frame, text="size")
81 #size_button.grid(row=0, column=2)
87 ##list part of the browser
89 #name_list_box=tk.Listbox(list_frame,exportselection=0, height=20, width=30)
94 #for x in range(0,list.length_of_list ):
98 # type_spaces=type_spaces* (10- len(list.type[x]))
99 # y=(list.name[x]+name_spaces+list.type[x]+list.size[x])
100 # print (list.name[x]+name_spaces+list.type[x]+list.size[x])
101 # name_list_box.insert(x,y)
102 #name_list_box.grid(column=0, row=1)
106 ##browser_frame.grid(row=1, column=0,columnspan=3 )
107 #name_list_box.bind("<Double-Button-1>", load_file)
112 root_window.mainloop()