cpython/Mac/Python/macsetfiletype.c

38 lines
556 B
C
Raw Normal View History

/*
* macsetfiletype - Set the mac's idea of file type
*
*/
1994-10-01 14:24:17 +00:00
#include "macdefs.h"
int
setfiletype(name, creator, type)
char *name;
long creator, type;
{
FInfo info;
unsigned char *pname;
pname = (StringPtr) Pstring(name);
if ( GetFInfo(pname, 0, &info) < 0 )
return -1;
info.fdType = type;
info.fdCreator = creator;
return SetFInfo(pname, 0, &info);
}
1995-02-13 11:31:51 +00:00
long
getfiletype(name)
char *name;
{
FInfo info;
unsigned char *pname;
pname = (StringPtr) Pstring(name);
if ( GetFInfo(pname, 0, &info) < 0 )
return -1;
return info.fdType;
}