"""Return true if the pathname refers to a symbolic link."""
try:
- import macfs
- return macfs.ResolveAliasFile(s)[2]
+ import Carbon.File
+ return Carbon.File.ResolveAliasFile(s, 0)[2]
except:
return False
def realpath(path):
path = abspath(path)
try:
- import macfs
+ import Carbon.File
except ImportError:
return path
if not path:
path = components[0] + ':'
for c in components[1:]:
path = join(path, c)
- path = macfs.ResolveAliasFile(path)[0].as_pathname()
+ path = Carbon.File.FSResolveAliasFile(path, 1)[0].as_pathname()
return path
supports_unicode_filenames = False
# Define an internal helper according to the platform
if os.name == "mac":
- import macfs
+ import MacOS
def set_creator_type(file):
- macfs.FSSpec(file).SetCreatorType('Pyth', 'PYC ')
+ MacOS.SetCreatorAndType(file, 'Pyth', 'PYC ')
else:
def set_creator_type(file):
pass
import unittest
import macostools
-import macfs
+import Carbon.File
import MacOS
import os
import sys
except:
pass
macostools.mkalias(test_support.TESTFN, TESTFN2)
- fss, _, _ = macfs.ResolveAliasFile(TESTFN2)
+ fss, _, _ = Carbon.File.ResolveAliasFile(TESTFN2, 0)
self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN))
def test_mkalias_relative(self):
except:
pass
macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix)
- fss, _, _ = macfs.ResolveAliasFile(TESTFN2)
+ fss, _, _ = Carbon.File.ResolveAliasFile(TESTFN2, 0)
self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN))