1 #! /usr/local/bin/python -O
4 Dummy VFS for Midnight Commander. Just for a test.
6 Author: Oleg BroytMann <phd@phd.pp.ru>.
7 Copyright (C) 2004 PhiloSoft Design.
13 __revision__ = "$Id: dummy,v 1.5 2004/06/13 10:18:37 phd Exp $"
14 __date__ = "$Date: 2004/06/13 10:18:37 $"[7:-2]
15 __author__ = "Oleg Broytmann <phd@phd.pp.ru>"
16 __copyright__ = "Copyright (C) 2004 PhiloSoft Design"
22 sys.stderr.write(msg + '\n')
31 It is not a program - it is a dummy VFS for Midnight Commander.
32 Put it in /usr/lib/mc/extfs.""")
36 """List the entire VFS"""
37 # Ignore the VFS name (sys.argv[2])
38 # Emit a dummy listing
39 print "-r--r--r-- 1 user group 0 Jun 13 02:20 file0"
40 print "-r--r--r-- 1 user group 1 Jun 13 02:21 file1"
41 print "dr--r--r-- 1 user group 2 Jun 13 02:22 subdir"
42 print "-r--r--r-- 1 user group 3 Jun 13 02:23 subdir/file3"
43 print "-r--r--r-- 1 user group 4 Jun 13 02:23 subdir/file4"
46 def mcdummy_copyout():
47 """Extract a file from the VFS"""
48 # Ignore the VFS name (sys.argv[2])
49 dummy_filename = sys.argv[3]
50 real_filename = sys.argv[4]
52 real_file = open(real_filename, 'w')
53 real_file.write("Copied from %s\n" % dummy_filename)
54 real_file.write("Copied to %s\n" % real_filename)
60 procname = "mcdummy_" + command
62 if not g.has_key(procname):
63 error("Unknown command %s" % command)