MCPcopy Create free account
hub / github.com/NetHack/NetHack / chdirx

Function chdirx

sys/share/pcmain.c:673–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

671
672#ifdef CHDIR
673void
674chdirx(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

Callers 4

getlockFunction · 0.70
pcunix.cFile · 0.70
pcsys.cFile · 0.70
pcmainFunction · 0.70

Calls 4

check_recordfileFunction · 0.85
errorFunction · 0.70
chdirFunction · 0.50
chdriveFunction · 0.50

Tested by

no test coverage detected