Skip to content

SafeGuard Protection

LavaAfterburner edited this page Jun 10, 2019 · 7 revisions

The SafeGuard

The SafeGuard is a class used to avoid dangerous mishaps (e.g. "delete the c drive please"). It's enabled by default. It protects you from the following operations on folders that are "low level":

  • Delete
  • Deleting files
  • Deleteif files
  • Collapsing sub folders
  • Moving the folder
  • Renaming files
  • Renaming sub folders

To disable the SafeGuard, add the following code at the beginning of your prorgam:

import fl

fl.SafeGuard.disable()

Which files are considered "low level":

Folders that are within the depth 7 are considered "low level". That means, any file / folder where the count of folders containing the file / folder is less than or equal to 7

E.g.

C:\Users\YourName\Documents\Programming\Python
^    ^      ^         ^          ^        ^
1    2      3         4          5        6

Because this folder is only 6 deep, it is still protected by the SafeGuard

Clone this wiki locally