view Mac/Python/macsetfiletype.c @ 1892:eec0dc5aba60 legacy-trunk

gestaltmodule.c: interface to Gestalt Manager. macosmodule.c: interface to random collection of Managers. macsetfiletype.c: set file type, for import.c.
author Guido van Rossum <guido@python.org>
date Fri, 16 Sep 1994 10:54:21 +0000
parents
children 275951b08608
line wrap: on
line source


/*
 *  macsetfiletype - Set the mac's idea of file type
 *
 */
 
#include <Files.h>
#include <pascal.h>

int
setfiletype(name, creator, type)
char *name;
long creator, type;
{
	FInfo info;
	unsigned char *pname;
	
	pname = c2pstr(name);
	if ( GetFInfo(pname, 0, &info) < 0 )
		return -1;
	info.fdType = type;
	info.fdCreator = creator;
	return SetFInfo(pname, 0, &info);
}