manipulation routines can be used on non-Mac platforms (e.g. to
manipulate pathnames in a Mac specific archive).
# module 'macpath' -- pathname (or -related) operations for the Macintosh
import string
-import mac
+import os
from stat import *
def isdir(s):
try:
- st = mac.stat(s)
- except mac.error:
+ st = os.stat(s)
+ except os.error:
return 0
return S_ISDIR(st[ST_MODE])
def isfile(s):
try:
- st = mac.stat(s)
- except mac.error:
+ st = os.stat(s)
+ except os.error:
return 0
return S_ISREG(st[ST_MODE])
def exists(s):
try:
- st = mac.stat(s)
- except mac.error:
+ st = os.stat(s)
+ except os.error:
return 0
return 1
def walk(top, func, arg):
try:
- names = mac.listdir(top)
- except mac.error:
+ names = os.listdir(top)
+ except os.error:
return
func(arg, top, names)
for name in names: