Subversion Repositories freemyipod

Rev

Rev 482 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 482 Rev 483
Line 1176... Line 1176...
1176
                self.logger.info(entry.name.ljust(50) + " - " + size + "\n")
1176
                self.logger.info(entry.name.ljust(50) + " - " + size + "\n")
1177
            except: break
1177
            except: break
1178
        self.emcore.dir_close(handle)
1178
        self.emcore.dir_close(handle)
1179
    
1179
    
1180
    @command
1180
    @command
-
 
1181
    def find(self, path = "/"):
-
 
1182
        """
-
 
1183
            Lists all files in the specified path, recursively
-
 
1184
            [path]: the path which is listed
-
 
1185
        """
-
 
1186
        handle = self.emcore.dir_open(path)
-
 
1187
        self.logger.info(path + "/\n")
-
 
1188
        while True:
-
 
1189
            try:
-
 
1190
                entry = self.emcore.dir_read(handle)
-
 
1191
                if entry.name == "." or entry.name == "..": continue
-
 
1192
                elif entry.attributes & 0x10: self.find(path + "/" + entry.name)
-
 
1193
                else: self.logger.info(path + "/" + entry.name + "\n")
-
 
1194
            except: break
-
 
1195
        self.emcore.dir_close(handle)
-
 
1196
    
-
 
1197
    @command
1181
    def malloc(self, size):
1198
    def malloc(self, size):
1182
        """ Allocates <size> bytes and returns a pointer to the allocated memory """
1199
        """ Allocates <size> bytes and returns a pointer to the allocated memory """
1183
        size = self._hexint(size)
1200
        size = self._hexint(size)
1184
        self.logger.info("Allocating %d bytes of memory\n" % size)
1201
        self.logger.info("Allocating %d bytes of memory\n" % size)
1185
        addr = self.emcore.malloc(size)
1202
        addr = self.emcore.malloc(size)