Guido van Rossum | 2d16703 | 1994-09-16 10:54:21 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * macsetfiletype - Set the mac's idea of file type |
| 4 | * |
| 5 | */ |
| 6 | |
Guido van Rossum | 950d47f | 1994-10-01 14:24:17 +0000 | [diff] [blame] | 7 | #include "macdefs.h" |
Guido van Rossum | 2d16703 | 1994-09-16 10:54:21 +0000 | [diff] [blame] | 8 | |
| 9 | int |
| 10 | setfiletype(name, creator, type) |
| 11 | char *name; |
| 12 | long creator, type; |
| 13 | { |
| 14 | FInfo info; |
| 15 | unsigned char *pname; |
| 16 | |
Jack Jansen | d50e4e1 | 1995-01-18 13:58:04 +0000 | [diff] [blame^] | 17 | pname = (StringPtr) Pstring(name); |
Guido van Rossum | 2d16703 | 1994-09-16 10:54:21 +0000 | [diff] [blame] | 18 | if ( GetFInfo(pname, 0, &info) < 0 ) |
| 19 | return -1; |
| 20 | info.fdType = type; |
| 21 | info.fdCreator = creator; |
| 22 | return SetFInfo(pname, 0, &info); |
| 23 | } |
| 24 | |