forked from vortec/vfs_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandler.py
More file actions
33 lines (28 loc) · 841 Bytes
/
handler.py
File metadata and controls
33 lines (28 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
def connect(service='default', user='default'):
debug('{} has connected to {}.'.format(user, service))
return True
def mkdir(path):
debug('Create dir: {}'.format(path))
return True
def rmdir(path):
debug('Remove dir: {}'.format(path))
if path == 'dont_touch_this':
debug(2, 'rmdir denied for: {}'.format(path))
return False
return True
def create_file(path):
debug('Create file: {}'.format(path))
if path == 'bad_file':
return False
return True
def rename(source, target):
debug('Rename file: {} -> {}'.format(source, target))
if target == 'bad_file':
return False
return True
def unlink(path):
debug('Unlink: {}'.format(path))
if path == 'mc_hammer':
debug(2, 'unlink denied for: {}'.format(path))
return False
return True