mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Added as_pathname() method to FSRef objects.
This commit is contained in:
		
							parent
							
								
									109f0945e4
								
							
						
					
					
						commit
						ba4fe77fba
					
				
					 1 changed files with 17 additions and 1 deletions
				
			
		|  | @ -773,10 +773,26 @@ mfsr_as_fsspec(mfsrobject *self, PyObject *args) | |||
| 	return (PyObject *)newmfssobject(&fss); | ||||
| } | ||||
| 
 | ||||
| static PyObject * | ||||
| mfsr_as_pathname(mfsrobject *self, PyObject *args) | ||||
| { | ||||
| 	char strbuf[PATHNAMELEN]; | ||||
| 	OSStatus err; | ||||
| 	 | ||||
| 	if (!PyArg_ParseTuple(args, "")) | ||||
| 		return NULL; | ||||
| 	err = FSRefMakePath(&self->fsref, strbuf, PATHNAMELEN); | ||||
| 	if ( err ) { | ||||
| 		PyErr_Mac(ErrorObject, err); | ||||
| 		return NULL; | ||||
| 	} | ||||
| 	return PyString_FromString(strbuf); | ||||
| } | ||||
| 
 | ||||
| static struct PyMethodDef mfsr_methods[] = { | ||||
| 	{"as_fsspec",		(PyCFunction)mfsr_as_fsspec,	1}, | ||||
| 	{"as_pathname",		(PyCFunction)mfsr_as_pathname,			1}, | ||||
| #if 0 | ||||
| 	{"as_pathname",		(PyCFunction)mfss_as_pathname,			1}, | ||||
| 	{"as_tuple",		(PyCFunction)mfss_as_tuple,				1}, | ||||
| 	{"NewAlias",		(PyCFunction)mfss_NewAlias,				1}, | ||||
| 	{"NewAliasMinimal",	(PyCFunction)mfss_NewAliasMinimal,		1}, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jack Jansen
						Jack Jansen