Don't reference removed files in Makefile
[python/dscho.git] / Mac / Compat / chdir.c
blobbc9a30354f187f71c253c818539ab162fb5cf0cb
1 /* Chdir for the Macintosh.
2 Public domain by Guido van Rossum, CWI, Amsterdam (July 1987).
3 Pathnames must be Macintosh paths, with colons as separators. */
5 #include "macdefs.h"
7 /* Last directory used by Standard File */
8 #define SFSaveDisk (*(short *)0x214)
9 #define CurDirStore (*(long *)0x398)
11 /* Change current directory. */
13 int
14 chdir(path)
15 char *path;
17 WDPBRec pb;
19 pb.ioNamePtr= (StringPtr) Pstring(path);
20 pb.ioVRefNum= 0;
21 pb.ioWDDirID= 0;
22 if (PBHSetVol(&pb, FALSE) != noErr) {
23 errno= ENOENT;
24 return -1;
26 if (PBHGetVol(&pb, FALSE) == noErr) {
27 /* Set the Standard File directory */
28 SFSaveDisk= -pb.ioWDVRefNum;
29 CurDirStore= pb.ioWDDirID;
31 return 0;