How do I use SD Card? The code (SD1.2.4) has issues (probably timing)

I am trying to use a sketch

  created  28 Mar 2011
  by Limor Fried
  modified 9 Apr 2012
  by Tom Igoe

with some cough local changes. The full sketch as run (NB #if 1 becomes #if 0 for failure) is attached.
I tried to search for help, but it’s like there’s some religious war going on with SD Card libraries.

The sketch fails. I was using an AData 60X 512MB full size SD Card

When I modified the library code (SdFat.h, SD.h, SdFile.cpp, SdVolume.cpp, Sd2Card.cpp, ) to add some tracing, it works! When my extra tracing is not enable (via runtime call), it fails again. examples of tracing code (X 50 or so) put at very top of functions is

  if(pPrintDebug_) { pPrintDebug_->print(F("Sd2Card::")); pPrintDebug_->print(__FUNCTION__); pPrintDebug_->println(__LINE__, DEC); }

Code changes are in SdFile.cpp, SdVolume.cpp, Sd2Card.cpp
‘Glue’ code changes in SdFat.h, SD.h like

    static void SetPrintDebug(Print* pPrintDebug) { pPrintDebug_ = pPrintDebug; }
    static Print* GetPrintDebug() { return pPrintDebug_; }
    static Print* pPrintDebug_;

And adding instance of pPrintDebug_ in *.cpp.
The results indicate to me that there is a timing issue ‘somewhere’.
Anyway, output follows - failing and working. First, the failing …

Oct  4 2020 @ 17:43:14
/home/bryan/git/BrewArduino/ArduinoSensors/MH-SD_Card_Info/MH-SD_Card_Info.ino
chipSelect            =4
SPI_MOSI_PIN (Nano:11)=11
SPI_MISO_PIN (Nano:12)=12
SPI_SCK_PIN  (Nano:13)=13

Initializing SD card...Wiring is correct and a card is present.

Card type:         SD1
Could not find FAT16/FAT32 partition.
Make sure you've formatted the card

and with tracing enabled and so working …

Oct  4 2020 @ 17:43:29
/home/bryan/git/BrewArduino/ArduinoSensors/MH-SD_Card_Info/MH-SD_Card_Info.ino
chipSelect            =4
SPI_MOSI_PIN (Nano:11)=11
SPI_MISO_PIN (Nano:12)=12
SPI_SCK_PIN  (Nano:13)=13

Initializing SD card...Sd2Card::init263
Sd2Card::cardCommand115
Sd2Card::readEnd485
Sd2Card::waitNotBusy587
Sd2Card::cardCommand115
Sd2Card::readEnd485
Sd2Card::waitNotBusy587
Sd2Card::cardCommand115
Sd2Card::readEnd485
Sd2Card::waitNotBusy587
Sd2Card::cardCommand115
Sd2Card::readEnd485
Sd2Card::waitNotBusy587
Sd2Card::cardCommand115
Sd2Card::readEnd485
Sd2Card::waitNotBusy587
Sd2Card::cardCommand115
Sd2Card::readEnd485
Sd2Card::waitNotBusy587
Sd2Card::setSckRate547
Wiring is correct and a card is present.

Card type:         SD1
SdVolume::init286
SdVolume::cacheRawBlock145
SdVolume::cacheFlush114
Sd2Card::readBlock396
Sd2Card::readData412
Sd2Card::cardCommand115
Sd2Card::readEnd485
Sd2Card::waitNotBusy587
Sd2Card::waitStartBlock601
Sd2Card::readEnd485
SdVolume::cacheRawBlock145
SdVolume::cacheFlush114
Sd2Card::readBlock396
Sd2Card::readData412
Sd2Card::cardCommand115
Sd2Card::readEnd485
Sd2Card::waitNotBusy587
Sd2Card::waitStartBlock601
Sd2Card::readEnd485
Clusters:          62430
Blocks x Cluster:  16
Total Blocks:      998880

Volume type is:    FAT16
Volume size (Kb):  499440
Volume size (Mb):  487
Volume size (Gb):  0.48

Files found on the card (name, date and size in bytes): 
SdFile::openRoot669
SdFile::ls242
SdFile::readDirCache896
SdFile::read789
SdVolume::cacheRawBlock145
SdVolume::cacheFlush114
Sd2Card::readBlock396
Sd2Card::readData412
Sd2Card::cardCommand115
Sd2Card::readEnd485
Sd2Card::waitNotBusy587
Sd2Card::waitStartBlock601
Sd2Card::readEnd485
SdFile::readDirCache896
SdFile::read789
SdVolume::cacheRawBlock145
SdFile::readDirCache896
SdFile::read789
SdVolume::cacheRawBlock145
SdFile::readDirCache896
SdFile::read789
SdVolume::cacheRawBlock145
SdFile::printDirName709
HELLOW~1.TXT  SdFile::printFatDate739
2020-10-03 SdFile::printFatTime754
03:15:22 13
SdFile::readDirCache896
SdFile::read789
SdVolume::cacheRawBlock145

MH-SD_Card_Info.ino (4.28 KB)

Well, I found the source on GitHub (why is it so hard to find things about Arduino code?). It's in GitHub - arduino-libraries/SD: SD Library for Arduino which might be obvious to some, but it took me a while to track it down.
I'll have a rummage there and see what I can found out.