pic32/libraries/SD/utility/SdFile.cpp
//------------------------------------------------------------------------------
/**
 * Remove a file.
 *
 * The directory entry and all data for the file are deleted.
 *
 * \note This function should not be used to delete the 8.3 version of a
 * file that has a long name. For example if a file has the long name
 * "New Text Document.txt" you should not delete the 8.3 name "NEWTEX~1.TXT".
 *
 * \return The value one, true, is returned for success and
 * the value zero, false, is returned for failure.
 * Reasons for failure include the file read-only, is a directory,
 * or an I/O error occurred.
 */
Remove a file.
The directory entry and all data for the file are deleted.

\note This function should not be used to delete the 8.3 version of a
file that has a long name. For example if a file has the long name
"New Text Document.txt" you should not delete the 8.3 name "NEWTEX~1.TXT".

\return The value one, true, is returned for success and
the value zero, false, is returned for failure.
Reasons for failure include the file read-only, is a directory,
or an I/O error occurred.
Remove a file . The directory entry and all data for the file are deleted . \ note This function should not be used to delete the 8 . 3 version of a file that has a long name . For example if a file has the long name " New Text Document . txt " you should not delete the 8 . 3 name " NEWTEX~1 . TXT " . \ return The value one true is returned for success and the value zero false is returned for failure . Reasons for failure include the file read - only is a directory or an I / O error occurred .
uint8_t SdFile::remove(void) {
  if (!truncate(0)) return false;
  dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE);
  if (!d) return false;
  d->name[0] = DIR_NAME_DELETED;
  type_ = FAT_FILE_TYPE_CLOSED;
  return SdVolume::cacheFlush();
}
uint8_t SdFile :: remove ( void ) { if ( ! truncate ( 0 ) ) return false ; dir_t * d = cacheDirEntry ( SdVolume :: CACHE_FOR_WRITE ) ; if ( ! d ) return false ; d -> name [ 0 ] = DIR_NAME_DELETED ; type_ = FAT_FILE_TYPE_CLOSED ; return SdVolume :: cacheFlush ( ) ; }
Remove a file.
Remove a file .
// free any clusters - will fail if read-only or directory // cache directory entry // mark entry deleted // set this SdFile closed // write entry to SD