diff 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 diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Mac/Python/macsetfiletype.c	Fri Sep 16 10:54:21 1994 +0000
@@ -0,0 +1,25 @@
+
+/*
+ *  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);
+}
+