[Python-checkins] python/dist/src/Demo/threads find.py,1.6,1.6.24.1

jhylton@users.sourceforge.net jhylton@users.sourceforge.net
Mon, 28 Apr 2003 10:39:51 -0700


Update of /cvsroot/python/python/dist/src/Demo/threads
In directory sc8-pr-cvs1:/tmp/cvs-serv27228/Demo/threads

Modified Files:
      Tag: ast-branch
	find.py 
Log Message:
Merge head to this branch.

Merge all sorts of changes from just before 2.3b1 into the ast
branch.  This should make the eventual merge back to the trunk easier.

The merge is almost entirely porting changes into the ast-branch.
There was no attempt to get changes to compile.c into newcompile.c.
That work should be done when newcompile.c is closer to completion.

The only significant conflicts appeared to be in pythonrun.c.


Index: find.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/threads/find.py,v
retrieving revision 1.6
retrieving revision 1.6.24.1
diff -C2 -d -r1.6 -r1.6.24.1
*** find.py	21 Jan 2001 07:06:51 -0000	1.6
--- find.py	28 Apr 2003 17:38:18 -0000	1.6.24.1
***************
*** 4,15 ****
  # It really does do more stats/sec when using multiple threads,
  # although the improvement is only about 20-30 percent.
  
  # I'm too lazy to write a command line parser for the full find(1)
  # command line syntax, so the predicate it searches for is wired-in,
  # see function selector() below.  (It currently searches for files with
! # group or world write permission.)
  
  # Usage: parfind.py [-w nworkers] [directory] ...
! # Default nworkers is 4, maximum appears to be 8 (on Irix 4.0.2)
  
  
--- 4,17 ----
  # It really does do more stats/sec when using multiple threads,
  # although the improvement is only about 20-30 percent.
+ # (That was 8 years ago.  In 2002, on Linux, I can't measure
+ # a speedup. :-( )
  
  # I'm too lazy to write a command line parser for the full find(1)
  # command line syntax, so the predicate it searches for is wired-in,
  # see function selector() below.  (It currently searches for files with
! # world write permission.)
  
  # Usage: parfind.py [-w nworkers] [directory] ...
! # Default nworkers is 4
  
  
***************
*** 99,103 ****
  
  def main():
-     sys.argv.append("/tmp")
      nworkers = 4
      opts, args = getopt.getopt(sys.argv[1:], '-w:')
--- 101,104 ----
***************
*** 123,128 ****
  
  def selector(dir, name, fullname, stat):
!     # Look for group or world writable files
!     return (stat[ST_MODE] & 0022) != 0
  
  
--- 124,129 ----
  
  def selector(dir, name, fullname, stat):
!     # Look for world writable files that are not symlinks
!     return (stat[ST_MODE] & 0002) != 0 and not S_ISLNK(stat[ST_MODE])