MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / statSync_inner

Function statSync_inner

python/pythonmonkey/require.py:225–238  ·  view source on GitHub ↗

Inner function for statSync. Returns: Union[Dict[str, int], False]: The mode of the file or False if the file doesn't exist.

(filename: str)

Source from the content-addressed store, hash-verified

223
224
225def statSync_inner(filename: str) -> Union[Dict[str, int], bool]:
226 """
227 Inner function for statSync.
228
229 Returns:
230 Union[Dict[str, int], False]: The mode of the file or False if the file doesn't exist.
231 """
232 from os import stat
233 filename = os.path.normpath(filename)
234 if (os.path.exists(filename)):
235 sb = stat(filename)
236 return {'mode': sb.st_mode}
237 else:
238 return False
239
240
241def readFileSync(filename, charset) -> str:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected