SealSkin
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) -> None

Copy a directory tree, tolerating dangling symlinks.

paramsrcstr

Source directory.

paramdststr

Destination directory (must not exist).

paramsymlinksbool
= True

Copy symlinks as symlinks instead of following them.

Returns

None
funcsafe_rmtree(path) -> None

Remove a directory tree, translating permission errors to HTTP 403.

parampathstr

Directory to remove.

Returns

None
funcunique_filename(directory, filename) -> str

Return filename or a name-N.ext variant that does not exist yet.

paramdirectorystr

Directory the file will be placed in.

paramfilenamestr

Desired file name.

Returns

str

A file name that is free inside directory.

funcsanitize_for_filename(name) -> str

Turn an arbitrary display name into a safe directory name.

paramnamestr

Display name such as an application name.

Returns

str

Lower-case ASCII letters, digits and dashes, at most 50 characters,