{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"Network File System (NFS)","type":"basic","slug":"network-file-system-nfs","excerpt":"","body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Go to **[api.safedev.org](https://api.safedev.org/)** to find the latest version of the API Docs.\",\n  \"title\": \"The API Docs have moved to a new website\"\n}\n[/block]\nThe NFS API can be used to create directories and files on the SAFE Network.\n\nThe NFS API enables the creation of private and public directories. Private directories are encrypted with the user’s MAID keys and thus are only accessible by the user. Public directories are stored as unencrypted data on the network. Public directories can be used to share public data.\n\nPublic directories are created mostly to map with a service and long name using the DNS API, making it easy to share.\n\nA directory called `SAFEDrive` can be used to store data that needs to be shared between multiple apps. This directory exists independently of any app.\n\nWhen an app is authorised by a user for the first time, SAFE Launcher creates an exclusive directory for that app. This is the app’s root directory, and it's sandboxed such that other apps cannot access its content. So if the app wants to create its own configuration files, directories...etc..., which it does not want to share with other apps, it can put them into its dedicated root directory.\n\nApplications can create directories and files in their dedicated root directory or in the SAFE Drive of the user. To access SAFE Drive, the application must be authorised with the `SAFE_DRIVE_ACCESS` permission.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"NFS API Conventions\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"rootPath\",\n    \"0-1\": \"An enum representation of the root directory.\\n\\nAccepted value - `app` or `drive`\\n\\n`app` specifies the application’s root directory, while `drive` corresponds to SAFE Drive.\\n\\nFor example, `/home/images/` can either refer to `/SAFEDrive/home/images/` or `/sample-app-root-dir/home/images/` depending on if rootPath refers to `drive` or `app` respectively.\",\n    \"1-0\": \"directoryPath\",\n    \"1-1\": \"The full path of the directory (e.g. `/home/images/`).\",\n    \"2-0\": \"isPrivate\",\n    \"2-1\": \"A boolean value to indicate whether the directory being created is private or public.\",\n    \"3-1\": \"The full path of the file (e.g. `/home/images/sample.png`).\",\n    \"3-0\": \"filePath\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]","updates":[],"order":4,"isReference":false,"hidden":true,"sync_unique":"","link_url":"","link_external":false,"_id":"57a238e5d778850e0047e3c5","project":"5656d449a795770d00a2aec1","version":{"version":"0.5","version_clean":"0.5.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5721e9c849df4f0e00528320","5721e9c849df4f0e00528321","5721e9c849df4f0e00528322","5721e9c849df4f0e00528323","5721e9c849df4f0e00528324","5721e9c849df4f0e00528325","5721e9c849df4f0e00528326","5721e9c849df4f0e00528327","5721e9c849df4f0e00528328","5721e9c849df4f0e00528329","5a6f6fc5043d990023daeb09"],"_id":"5721e9c849df4f0e0052831f","releaseDate":"2016-04-28T10:45:28.369Z","hasReference":true,"project":"5656d449a795770d00a2aec1","createdAt":"2016-04-28T10:45:28.369Z","hasDoc":true,"__v":2},"__v":0,"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"SAFE Launcher API","slug":"safe-launcher-api-1","order":3,"from_sync":false,"reference":false,"_id":"5721e9c849df4f0e00528328","project":"5656d449a795770d00a2aec1","createdAt":"2016-03-07T18:25:17.849Z","__v":0,"version":"5721e9c849df4f0e0052831f"},"createdAt":"2016-08-03T18:33:09.350Z","parentDoc":null,"user":"54ad4a56f6f5b10b0066dc86","githubsync":""}

Network File System (NFS)


[block:callout] { "type": "info", "body": "Go to **[api.safedev.org](https://api.safedev.org/)** to find the latest version of the API Docs.", "title": "The API Docs have moved to a new website" } [/block] The NFS API can be used to create directories and files on the SAFE Network. The NFS API enables the creation of private and public directories. Private directories are encrypted with the user’s MAID keys and thus are only accessible by the user. Public directories are stored as unencrypted data on the network. Public directories can be used to share public data. Public directories are created mostly to map with a service and long name using the DNS API, making it easy to share. A directory called `SAFEDrive` can be used to store data that needs to be shared between multiple apps. This directory exists independently of any app. When an app is authorised by a user for the first time, SAFE Launcher creates an exclusive directory for that app. This is the app’s root directory, and it's sandboxed such that other apps cannot access its content. So if the app wants to create its own configuration files, directories...etc..., which it does not want to share with other apps, it can put them into its dedicated root directory. Applications can create directories and files in their dedicated root directory or in the SAFE Drive of the user. To access SAFE Drive, the application must be authorised with the `SAFE_DRIVE_ACCESS` permission. [block:api-header] { "type": "basic", "title": "NFS API Conventions" } [/block] [block:parameters] { "data": { "h-0": "Field", "h-1": "Description", "0-0": "rootPath", "0-1": "An enum representation of the root directory.\n\nAccepted value - `app` or `drive`\n\n`app` specifies the application’s root directory, while `drive` corresponds to SAFE Drive.\n\nFor example, `/home/images/` can either refer to `/SAFEDrive/home/images/` or `/sample-app-root-dir/home/images/` depending on if rootPath refers to `drive` or `app` respectively.", "1-0": "directoryPath", "1-1": "The full path of the directory (e.g. `/home/images/`).", "2-0": "isPrivate", "2-1": "A boolean value to indicate whether the directory being created is private or public.", "3-1": "The full path of the file (e.g. `/home/images/sample.png`).", "3-0": "filePath" }, "cols": 2, "rows": 4 } [/block]