MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / SetCurrentDir

Function SetCurrentDir

source/Utilities.cpp:363–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361}
362
363static void SetCurrentDir(const std::string & pathname)
364{
365 // Due to the order HDDs/disks are inserted, then s7 insertions take priority over s6 & s5; and d2 takes priority over d1:
366 // . if -s6[dN] and -hN are specified, then g_sCurrentDir will be set to the HDD image's path
367 // . if -s5[dN] and -s6[dN] are specified, then g_sCurrentDir will be set to the s6 image's path
368 // . if -[sN]d1 and -[sN]d2 are specified, then g_sCurrentDir will be set to the d2 image's path
369 // This is purely dependent on the current order of InsertFloppyDisks() & InsertHardDisks() - ie. very brittle!
370 // . better to use -current-dir to be explicit
371 std::size_t found = pathname.find_last_of(PATH_SEPARATOR);
372 std::string path = pathname.substr(0, found);
373 SetCurrentImageDir(path);
374}
375
376static bool DoDiskInsert(const UINT slot, const int nDrive, LPCSTR szFileName)
377{

Callers 2

DoDiskInsertFunction · 0.85
DoHardDiskInsertFunction · 0.85

Calls 1

SetCurrentImageDirFunction · 0.85

Tested by

no test coverage detected