# Adapting for Rootless
### What is rootless?
- "rootless" is the term used for jailbreaks which do not have access to the root filesystem. This means that anything outside of `/var/` and `/private/preboot/` is not writable. However, the root **user** is still accessibly on a rootless jailbreak.
### How does this affect my tweak?
- Existing tweaks which do not support rootless will need some changes in order to work on a rootless jailbreak. For instance, preference bundles are stored in `/Library/PreferenceBundles/` on a traditional ("rootful") jailbreak. However, since a rootless jailbreak does not have the ability to write to outside of the aforementioned directories, there needs to be a change made to the path in order to work properly. On rootless jailbreaks, the jailbreak files are stored in `/var/jb/`. Thus, the path becomes `/var/jb/Library/PreferenceBundles/`. This is the main difference between "rootless" and "rootful" jailbreaks.
---
### How can I adapt my tweak for rootless?
Firsrly, it is best to always use the most up-to-date version of Theos. Make sure to update it if you installed Theos a while ago.
Theos includes convenient macros for you to use in order to adapt for rootless. They are stored in a header file called [rootless.h](https://github.com/theos/headers/blob/master/rootless.h) which is bundled in recent versions. Say we have a file path that needs to be adapted stored within an `NSString` like so:
```objc
NSString *filePath = @"/Library/Application Support/";
```
This particular directory *does* exist in non-jailbroken iOS. On "rootful" jailbreaks, tweaks can write to this directory to store files. However, on "rootless" jailbreaks, there is no ability to do that. So, rootless jailbreaks write to `/var/jb/Library/Application Support/`. So how can we include the `/var/jb/` part of the path when compiling for "rootless" but not "rootful?" Well, the macros make that process quite simple. In order to utilize the macros, you need to `#import