Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

33
LINES

< > BotCompany Repo | #274 // Let's make a decent file manager!

Document

Let's make a decent "file manager".

A file manager should know which areas of the file system are safe and which are not.

(Some areas are not safe to modify, e.g. OS directories. And some areas may not even be safe to read, e.g. because reading there is "expensive".)

So a file manager would have a set of assumptions.

Let's put those in a file, e.g. "assumptions.txt". Simple lines of English text will suffice, like this:

  / is the root of everything.
  / is generally not safe.
  /usr is generally not safe. // This follows from previous line.
  /home/stefan is safe (except for symlinks of course).
  /home/<somethingelse> is generally not safe. // Also follows from all of the above.

By default (before loading any assumptions), a file manager will take the assumption that nothing is safe. This is BECAUSE IT IS A REAL PROGRAM ON A REAL COMPUTER AND IT SHOULD BETTER BE SAFE TO RUN which means it is in a war zone which means it should defaultly assume unsafety of its environment. :]


Applications
------------

The file manager will feature different sub-applications, for example one to backup up data.

A simple example task would be: "Backup all safe areas" which could make, say, a zip file of all these areas.


What we need
------------

A directory scanner that
-travels only safe areas
-does not follow symlinks (corollary of the above as following a symlink can take you out of a safe area).

download  show line numbers   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Image recognition results

Recognizer Recognition Result Visualize Recalc
#308 1450 [visualize]

Snippet ID: #274
Snippet name: Let's make a decent file manager!
Eternal ID of this version: #274/1
Text MD5: 7bb84ef9e7d9e3ae2e027327d5064c3f
Author: stefan
Category: exposes
Type: Document
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2014-06-01 15:24:18
Source code size: 1450 bytes / 33 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 745 / 204
Referenced in: [show references]