Server Reference
fsutil
Small filesystem helpers shared by the launch logic and the file manager.
attributelogger= logging.getLogger(__name__)funcsafe_copytree(src, dst, symlinks=True) -> NoneCopy a directory tree, tolerating dangling symlinks.
paramsrcstrSource directory.
paramdststrDestination directory (must not exist).
paramsymlinksbool= TrueCopy symlinks as symlinks instead of following them.
Returns
Nonefuncsafe_rmtree(path) -> NoneRemove a directory tree, translating permission errors to HTTP 403.
parampathstrDirectory to remove.
Returns
Nonefuncunique_filename(directory, filename) -> strReturn filename or a name-N.ext variant that does not exist yet.
paramdirectorystrDirectory the file will be placed in.
paramfilenamestrDesired file name.
Returns
strA file name that is free inside directory.
funcsanitize_for_filename(name) -> strTurn an arbitrary display name into a safe directory name.
paramnamestrDisplay name such as an application name.
Returns
strLower-case ASCII letters, digits and dashes, at most 50 characters,