Mercurial > hgrepos > hgweb.cgi > after5
comparison after5.rb @ 16:1ff30d4c58ce draft
RCS-revision 1.17
date: 2009/09/17 09:09:23; author: yuuji; state: Exp; lines: +5 -4
$0 is frozen.
Do job on duplicated instance.
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Thu, 17 Sep 2009 09:09:23 +0859 |
parents | 580c1b0fa27e |
children | 904bbce89e71 |
comparison
equal
deleted
inserted
replaced
15:580c1b0fa27e | 16:1ff30d4c58ce |
---|---|
1 #!/usr/local/bin/ruby | 1 #!/usr/local/bin/ruby |
2 # -*- coding: euc-jp -*- | |
2 # | 3 # |
3 # Associative Scheduling Table - after5 | 4 # Associative Scheduling Table - after5 |
4 # (C)2003, 2004, 2006, 2008 by HIROSE Yuuji [yuuji@gentei.org] | 5 # (C)2003, 2004, 2006, 2008 by HIROSE Yuuji [yuuji@gentei.org] |
5 # $Id: after5.rb,v 1.16 2008/03/16 06:24:44 yuuji Exp $ | 6 # $Id: after5.rb,v 1.17 2009/09/17 09:09:23 yuuji Exp $ |
6 # Last modified Sun Mar 16 15:22:32 2008 on firestorm | 7 # Last modified Thu Sep 17 18:08:23 2009 on spada |
7 # See http://www.gentei.org/~yuuji/software/after5/ | 8 # See http://www.gentei.org/~yuuji/software/after5/ |
8 # このスクリプトはEUCで保存してください。 | 9 # このスクリプトはEUCで保存してください。 |
9 | 10 |
10 require 'kconv' | 11 require 'kconv' |
11 | 12 |
811 end | 812 end |
812 # | 813 # |
813 # remove files in FILES, and remove parent directory if possible | 814 # remove files in FILES, and remove parent directory if possible |
814 def cleanup_files(files) | 815 def cleanup_files(files) |
815 sentinel = File.stat(@dir).ino | 816 sentinel = File.stat(@dir).ino |
816 $0.untaint | 817 me = $0.dup.untaint |
817 scriptsuid = File.stat($0).uid | 818 scriptsuid = File.stat(me).uid |
818 for f in files | 819 for f in files |
819 if $SAFE > 0 | 820 if $SAFE > 0 |
820 f.untaint | 821 f.untaint |
821 if test(?e, f) && File.stat(f).uid != scriptsuid | 822 if test(?e, f) && File.stat(f).uid != scriptsuid |
822 f.taint | 823 f.taint |