| 671 | |
| 672 | #ifdef CHDIR |
| 673 | void |
| 674 | chdirx(const char *dir, boolean wr) |
| 675 | { |
| 676 | #ifdef AMIGA |
| 677 | static char thisdir[] = ""; |
| 678 | #else |
| 679 | static char thisdir[] = "."; |
| 680 | #endif |
| 681 | if (dir && chdir(dir) < 0) { |
| 682 | error("Cannot chdir to %s.", dir); |
| 683 | } |
| 684 | |
| 685 | #ifndef AMIGA |
| 686 | /* Change the default drive as well. |
| 687 | */ |
| 688 | chdrive(dir); |
| 689 | #endif |
| 690 | |
| 691 | /* warn the player if we can't write the record file */ |
| 692 | /* perhaps we should also test whether . is writable */ |
| 693 | /* unfortunately the access system-call is worthless */ |
| 694 | if (wr) |
| 695 | check_recordfile(dir ? dir : thisdir); |
| 696 | } |
| 697 | #endif /* CHDIR */ |
| 698 | |
| 699 | #ifdef PORT_HELP |