SD library problem in IDE v1.0 beta-3

A little error seems to have cropped up in the latest beta IDE. In any sketch which uses the SD library, I get the following message:

C:\Users\Tim\Documents\Arduino\ide\v10b3\libraries\SD\File.cpp: In member function 'virtual size_t File::write(const uint8_t*, size_t)':
C:\Users\Tim\Documents\Arduino\ide\v10b3\libraries\SD\File.cpp:77: error: 'class SdFile' has no member named 'writeError'

This happens even with the example sketches. Everything is fine with v1.0 beta-2, yet as far as I can see the SD library hasn't changed. Any ideas?

I took a short look at the code. The declaration for writeError is in
/libraries/SD/utility/SDFat.h

If you want to check, look for this. Line 44 in v0022:

class SdFile : public Print {
public:
/** Create an instance of SdFile. /
SdFile(void) : type_(FAT_FILE_TYPE_CLOSED) {}
/
*

  • writeError is set to true if an error occurs during a write().
  • Set writeError to false before calling print() and/or write() and check
  • for true after calls to print() and/or write().
    */
    bool writeError;

You might want to look there and see if something has changed.

David Mellis is aware of this.

You can comment out the following code at about line 77 of arduino-1.0-beta3/libraries/SD/File.cpp

/*
  if (_file->writeError()) {
    setWriteError();
    return 0;
  }
*/

The error handling was moved to the write call but his code was not removed.

I think you just want to change writeError() to getWriteError(), not comment out the code.

OK, glad to hear it's a known problem. IDE 1.0 is a big improvement over v0022 and I've been using it as much as possible. Looking forward to the next beta-version.

Changing writeError() to getWriteError() or commenting out the block will give identical results.

The call to SdFat::write() above the block calls setWriteError() and returns zero.