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

Method name

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

Source from the content-addressed store, hash-verified

209
210 # Returns Directory/File Name
211 def name(self, block):
212 assert type(block) is int and 1 <= block <= self.__blocks
213 status = self.status(block)
214 assert status == self.STATUS.directory or status == self.STATUS.file
215 if status == self.STATUS.directory:
216 data = self.__disk.read_directory(block)
217 else:
218 data = self.__disk.read_file(block)
219 size = ord(data[2])
220 name = data[3:3+size]
221 return name
222
223 # Changes Directory/File Name
224 def rename(self, block, name):

Callers 2

findMethod · 0.95
list_directoryMethod · 0.45

Calls 3

statusMethod · 0.95
read_directoryMethod · 0.80
read_fileMethod · 0.45

Tested by

no test coverage detected