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

1  
Let's make a decent "file manager".
2  
3  
A file manager should know which areas of the file system are safe and which are not.
4  
5  
(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".)
6  
7  
So a file manager would have a set of assumptions.
8  
9  
Let's put those in a file, e.g. "assumptions.txt". Simple lines of English text will suffice, like this:
10  
11  
  / is the root of everything.
12  
  / is generally not safe.
13  
  /usr is generally not safe. // This follows from previous line.
14  
  /home/stefan is safe (except for symlinks of course).
15  
  /home/<somethingelse> is generally not safe. // Also follows from all of the above.
16  
17  
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. :]
18  
19  
20  
Applications
21  
------------
22  
23  
The file manager will feature different sub-applications, for example one to backup up data.
24  
25  
A simple example task would be: "Backup all safe areas" which could make, say, a zip file of all these areas.
26  
27  
28  
What we need
29  
------------
30  
31  
A directory scanner that
32  
-travels only safe areas
33  
-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: 696 / 186
Referenced in: [show references]