summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1997-06-16 14:31:38 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1997-06-16 14:31:38 (GMT)
commitd993648ef6f9e76cf847dfc8f66904f76c621894 (patch)
tree8d72adb3f19d5369572fba6441259648b263a52b /Mac
parent3b1c89e244e1b7dabaa6a3f2e5e939da29b0d2a1 (diff)
downloadcpython-d993648ef6f9e76cf847dfc8f66904f76c621894.zip
cpython-d993648ef6f9e76cf847dfc8f66904f76c621894.tar.gz
cpython-d993648ef6f9e76cf847dfc8f66904f76c621894.tar.bz2
Added NewAliasMinimalFromFullPath(), and allow alias.Resolve() to return
an FSSpec to a non-existing file.
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Modules/macfsmodule.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/Mac/Modules/macfsmodule.c b/Mac/Modules/macfsmodule.c
index 5bd2ce5..4bea8ce 100644
--- a/Mac/Modules/macfsmodule.c
+++ b/Mac/Modules/macfsmodule.c
@@ -99,7 +99,7 @@ mfsa_Resolve(self, args)
else
fromp = NULL;
err = ResolveAlias(fromp, self->alias, &result, &changed);
- if ( err ) {
+ if ( err && err != fnfErr ) {
PyErr_Mac(ErrorObject, err);
return NULL;
}
@@ -920,6 +920,32 @@ mfs_FInfo(self, args)
return (PyObject *)newmfsiobject();
}
+static PyObject *
+mfs_NewAliasMinimalFromFullPath(self, args)
+ PyObject *self; /* Not used */
+ PyObject *args;
+{
+ OSErr err;
+ char *fullpath;
+ int fullpathlen;
+ AliasHandle alias;
+ Str32 zonename;
+ Str31 servername;
+
+ if (!PyArg_ParseTuple(args, "s#", &fullpath, &fullpathlen) )
+ return NULL;
+ zonename[0] = 0;
+ servername[0] = 0;
+ err = NewAliasMinimalFromFullPath(fullpathlen, (Ptr)fullpath, zonename,
+ servername, &alias);
+ if ( err ) {
+ PyErr_Mac(ErrorObject, err);
+ return NULL;
+ }
+ return (PyObject *)newmfsaobject(alias);
+}
+
+
/* List of methods defined in the module */
static struct PyMethodDef mfs_methods[] = {
@@ -935,6 +961,7 @@ static struct PyMethodDef mfs_methods[] = {
{"FindFolder", mfs_FindFolder, 1},
{"FindApplication", mfs_FindApplication, 1},
{"FInfo", mfs_FInfo, 1},
+ {"NewAliasMinimalFromFullPath", mfs_NewAliasMinimalFromFullPath, 1},
{NULL, NULL} /* sentinel */
};