MCPcopy Create free account
hub / github.com/ActiveState/code / list_directory

Method list_directory

recipes/Python/492212_dal4py/recipe-492212.py:175–183  ·  view source on GitHub ↗
(self, block)

Source from the content-addressed store, hash-verified

173
174 # Get Directory Contents
175 def list_directory(self, block):
176 assert type(block) is int and 1 <= block <= self.__blocks
177 assert self.status(block) == self.STATUS.directory
178 directory = self.__disk.read_directory(block)
179 size = ord(directory[2])
180 contents = directory[3+size:]
181 pointers = [(ord(contents[index*2]) << 8) + ord(contents[index*2+1]) \
182 for index in range(len(contents) / 2)]
183 return pointers
184
185 # Check If Empty
186 def empty(self, block):

Callers 3

findMethod · 0.95
listdirMethod · 0.45
handle_dataMethod · 0.45

Calls 3

statusMethod · 0.95
rangeFunction · 0.85
read_directoryMethod · 0.80

Tested by

no test coverage detected