]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
macpath.cat --> join
authorGuido van Rossum <guido@python.org>
Fri, 16 Aug 1991 13:27:45 +0000 (13:27 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 16 Aug 1991 13:27:45 +0000 (13:27 +0000)
Lib/lib-old/packmail.py
Lib/macpath.py
Lib/packmail.py
Mac/Lib/maccache.py

index a964d6d11b402e50186324260aa90ea765af75da..2ff067d0c20257c9fb92ba7970e1462c0f498fec 100644 (file)
@@ -21,7 +21,7 @@ def pack(outfp, file, name):
 def packsome(outfp, dirname, names):
        for name in names:
                print name
-               file = macpath.cat(dirname, name)
+               file = macpath.join(dirname, name)
                pack(outfp, file, name)
 
 # Pack all files from a directory
@@ -33,13 +33,13 @@ def packall(outfp, dirname):
 # Pack all files from a directory that are not older than a give one
 def packnotolder(outfp, dirname, oldest):
        names = mac.listdir(dirname)
-       oldest = macpath.cat(dirname, oldest)
+       oldest = macpath.join(dirname, oldest)
        st = mac.stat(oldest)
        mtime = st[ST_MTIME]
        todo = []
        for name in names:
                print name, '...',
-               st = mac.stat(macpath.cat(dirname, name))
+               st = mac.stat(macpath.join(dirname, name))
                if st[ST_MTIME] >= mtime:
                        print 'Yes.'
                        todo.append(name)
@@ -55,7 +55,7 @@ def packtree(outfp, dirname):
        names = mac.listdir(dirname)
        subdirs = []
        for name in names:
-               fullname = macpath.cat(dirname, name)
+               fullname = macpath.join(dirname, name)
                if macpath.isdir(fullname):
                        subdirs.append(fullname)
                else:
index 99254abce0305e14dfe88f9ac9940de190461ebb..58cbb88e5003286b4c761dd06c5c91674942838d 100644 (file)
@@ -15,11 +15,11 @@ def isabs(s):
        return ':' in s and s[0] <> ':'
 
 
-# Concatenate two pathnames.
+# Join two pathnames.
 # The result is equivalent to what the second pathname would refer to
 # if the first pathname were the current directory.
 
-def cat(s, t):
+def join(s, t):
        if (not s) or isabs(t): return t
        if t[:1] = ':': t = t[1:]
        if ':' not in s:
@@ -29,9 +29,12 @@ def cat(s, t):
        return s + t
 
 
+cat = join # For compatibility
+
+
 # Split a pathname in two parts: the directory leading up to the final bit,
 # and the basename (the filename, without colons, in that directory).
-# The result (s, t) is such that cat(s, t) yields the original argument.
+# The result (s, t) is such that join(s, t) yields the original argument.
 
 def split(s):
        if ':' not in s: return '', s
index a964d6d11b402e50186324260aa90ea765af75da..2ff067d0c20257c9fb92ba7970e1462c0f498fec 100644 (file)
@@ -21,7 +21,7 @@ def pack(outfp, file, name):
 def packsome(outfp, dirname, names):
        for name in names:
                print name
-               file = macpath.cat(dirname, name)
+               file = macpath.join(dirname, name)
                pack(outfp, file, name)
 
 # Pack all files from a directory
@@ -33,13 +33,13 @@ def packall(outfp, dirname):
 # Pack all files from a directory that are not older than a give one
 def packnotolder(outfp, dirname, oldest):
        names = mac.listdir(dirname)
-       oldest = macpath.cat(dirname, oldest)
+       oldest = macpath.join(dirname, oldest)
        st = mac.stat(oldest)
        mtime = st[ST_MTIME]
        todo = []
        for name in names:
                print name, '...',
-               st = mac.stat(macpath.cat(dirname, name))
+               st = mac.stat(macpath.join(dirname, name))
                if st[ST_MTIME] >= mtime:
                        print 'Yes.'
                        todo.append(name)
@@ -55,7 +55,7 @@ def packtree(outfp, dirname):
        names = mac.listdir(dirname)
        subdirs = []
        for name in names:
-               fullname = macpath.cat(dirname, name)
+               fullname = macpath.join(dirname, name)
                if macpath.isdir(fullname):
                        subdirs.append(fullname)
                else:
index dc6502bda1c05ed1ec2f6d256a6880dc858474fd..47b673cf39a93c284fffa8d79b1511539d6b8bd3 100644 (file)
@@ -25,7 +25,7 @@ FILE = 1
 LISTTYPE = type([])
 
 def _stat(name):
-       name = macpath.cat(cwd, name)
+       name = macpath.join(cwd, name)
        if cache.has_key(name):
                return cache[name]
        if macpath.isfile(name):