您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

2338 行
111KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.6"/>
  7. <title>SdFat: SdBaseFile Class Reference</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  12. </head>
  13. <body>
  14. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  15. <div id="titlearea">
  16. <table cellspacing="0" cellpadding="0">
  17. <tbody>
  18. <tr style="height: 56px;">
  19. <td style="padding-left: 0.5em;">
  20. <div id="projectname">SdFat
  21. </div>
  22. </td>
  23. </tr>
  24. </tbody>
  25. </table>
  26. </div>
  27. <!-- end header part -->
  28. <!-- Generated by Doxygen 1.8.6 -->
  29. <div id="navrow1" class="tabs">
  30. <ul class="tablist">
  31. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  32. <li><a href="namespaces.html"><span>Namespaces</span></a></li>
  33. <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
  34. <li><a href="files.html"><span>Files</span></a></li>
  35. </ul>
  36. </div>
  37. <div id="navrow2" class="tabs2">
  38. <ul class="tablist">
  39. <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
  40. <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
  41. <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
  42. </ul>
  43. </div>
  44. </div><!-- top -->
  45. <div class="header">
  46. <div class="summary">
  47. <a href="#pub-methods">Public Member Functions</a> &#124;
  48. <a href="#pub-static-methods">Static Public Member Functions</a> &#124;
  49. <a href="#pub-attribs">Public Attributes</a> &#124;
  50. <a href="#friends">Friends</a> &#124;
  51. <a href="class_sd_base_file-members.html">List of all members</a> </div>
  52. <div class="headertitle">
  53. <div class="title">SdBaseFile Class Reference</div> </div>
  54. </div><!--header-->
  55. <div class="contents">
  56. <p>Base class for <a class="el" href="class_sd_file.html" title="SdBaseFile with Arduino Stream. ">SdFile</a> with Print and C++ streams.
  57. <a href="class_sd_base_file.html#details">More...</a></p>
  58. <p><code>#include &lt;SdBaseFile.h&gt;</code></p>
  59. <div class="dynheader">
  60. Inheritance diagram for SdBaseFile:</div>
  61. <div class="dyncontent">
  62. <div class="center"><img src="class_sd_base_file__inherit__graph.png" border="0" usemap="#_sd_base_file_inherit__map" alt="Inheritance graph"/></div>
  63. <map name="_sd_base_file_inherit__map" id="_sd_base_file_inherit__map">
  64. <area shape="rect" id="node3" href="class_sd_file.html" title="SdBaseFile with Arduino Stream. " alt="" coords="5,80,64,107"/> <area shape="rect" id="node5" href="class_sd_stream_base.html" title="Base class for SD streams. " alt="" coords="89,80,199,107"/> <area shape="rect" id="node13" href="class_stdio_stream.html" title="StdioStream implements a minimal stdio stream. " alt="" coords="223,80,317,107"/> <area shape="rect" id="node7" href="classfstream.html" title="SD file input/output stream. " alt="" coords="21,155,85,181"/> <area shape="rect" id="node9" href="classifstream.html" title="SD file input stream. " alt="" coords="110,155,177,181"/> <area shape="rect" id="node11" href="classofstream.html" title="SD card output stream. " alt="" coords="203,155,275,181"/> </map>
  65. <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
  66. <table class="memberdecls">
  67. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  68. Public Member Functions</h2></td></tr>
  69. <tr class="memitem:ac4381fe633716069f2161d9e9fef5d16"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ac4381fe633716069f2161d9e9fef5d16">available</a> ()</td></tr>
  70. <tr class="separator:ac4381fe633716069f2161d9e9fef5d16"><td class="memSeparator" colspan="2">&#160;</td></tr>
  71. <tr class="memitem:a6b4e639ae03ec48c9becd8b472aa1b50"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a6b4e639ae03ec48c9becd8b472aa1b50">clearWriteError</a> ()</td></tr>
  72. <tr class="separator:a6b4e639ae03ec48c9becd8b472aa1b50"><td class="memSeparator" colspan="2">&#160;</td></tr>
  73. <tr class="memitem:a17f7e949aa0f80d89782d8e31f5edc15"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a17f7e949aa0f80d89782d8e31f5edc15">close</a> ()</td></tr>
  74. <tr class="separator:a17f7e949aa0f80d89782d8e31f5edc15"><td class="memSeparator" colspan="2">&#160;</td></tr>
  75. <tr class="memitem:a272c68ba97eb5452ce903e6f8d2895a6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a272c68ba97eb5452ce903e6f8d2895a6">contiguousRange</a> (uint32_t *bgnBlock, uint32_t *endBlock)</td></tr>
  76. <tr class="separator:a272c68ba97eb5452ce903e6f8d2895a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
  77. <tr class="memitem:ad14a78d348219d6ce096582b6ed74526"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ad14a78d348219d6ce096582b6ed74526">createContiguous</a> (<a class="el" href="class_sd_base_file.html">SdBaseFile</a> *dirFile, const char *path, uint32_t size)</td></tr>
  78. <tr class="separator:ad14a78d348219d6ce096582b6ed74526"><td class="memSeparator" colspan="2">&#160;</td></tr>
  79. <tr class="memitem:afd2ed78a03600924ef6502a86d7c6291"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#afd2ed78a03600924ef6502a86d7c6291">curCluster</a> () const </td></tr>
  80. <tr class="separator:afd2ed78a03600924ef6502a86d7c6291"><td class="memSeparator" colspan="2">&#160;</td></tr>
  81. <tr class="memitem:a9739ca25a7c804cace68f95c14658c44"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a9739ca25a7c804cace68f95c14658c44">curPosition</a> () const </td></tr>
  82. <tr class="separator:a9739ca25a7c804cace68f95c14658c44"><td class="memSeparator" colspan="2">&#160;</td></tr>
  83. <tr class="memitem:a0977fc620f90e21897eca1fb1c25fdce"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a0977fc620f90e21897eca1fb1c25fdce">dirEntry</a> (dir_t *dir)</td></tr>
  84. <tr class="separator:a0977fc620f90e21897eca1fb1c25fdce"><td class="memSeparator" colspan="2">&#160;</td></tr>
  85. <tr class="memitem:aa0b95ccc568d483f1416d2eacd1ff3f7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#aa0b95ccc568d483f1416d2eacd1ff3f7">exists</a> (const char *name)</td></tr>
  86. <tr class="separator:aa0b95ccc568d483f1416d2eacd1ff3f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  87. <tr class="memitem:a41de4f35c622c1a5f5699400e8d05a87"><td class="memItemLeft" align="right" valign="top">int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a41de4f35c622c1a5f5699400e8d05a87">fgets</a> (char *str, int16_t num, char *delim=0)</td></tr>
  88. <tr class="separator:a41de4f35c622c1a5f5699400e8d05a87"><td class="memSeparator" colspan="2">&#160;</td></tr>
  89. <tr class="memitem:a32ac452756fdf80aae75fb1ab093a421"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a32ac452756fdf80aae75fb1ab093a421">fileSize</a> () const </td></tr>
  90. <tr class="separator:a32ac452756fdf80aae75fb1ab093a421"><td class="memSeparator" colspan="2">&#160;</td></tr>
  91. <tr class="memitem:adca5f8fce7851f9b7abc92cb73e49e35"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#adca5f8fce7851f9b7abc92cb73e49e35">firstCluster</a> () const </td></tr>
  92. <tr class="separator:adca5f8fce7851f9b7abc92cb73e49e35"><td class="memSeparator" colspan="2">&#160;</td></tr>
  93. <tr class="memitem:a2e84ccce858fd7e4d88e26b23d19a822"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a2e84ccce858fd7e4d88e26b23d19a822">getFilename</a> (char *name)</td></tr>
  94. <tr class="separator:a2e84ccce858fd7e4d88e26b23d19a822"><td class="memSeparator" colspan="2">&#160;</td></tr>
  95. <tr class="memitem:ad1af089e5cf0a4c86e9b6bae1595f59b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ad1af089e5cf0a4c86e9b6bae1595f59b">getpos</a> (<a class="el" href="struct_fat_pos__t.html">FatPos_t</a> *pos)</td></tr>
  96. <tr class="separator:ad1af089e5cf0a4c86e9b6bae1595f59b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  97. <tr class="memitem:aa8ebd3ec28126c3171059d3e7dd355b9"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#aa8ebd3ec28126c3171059d3e7dd355b9">getWriteError</a> ()</td></tr>
  98. <tr class="separator:aa8ebd3ec28126c3171059d3e7dd355b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. <tr class="memitem:ad43ed061a1f77578d3c30a0f9b198497"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ad43ed061a1f77578d3c30a0f9b198497">isDir</a> () const </td></tr>
  100. <tr class="separator:ad43ed061a1f77578d3c30a0f9b198497"><td class="memSeparator" colspan="2">&#160;</td></tr>
  101. <tr class="memitem:ab57b9744531ee0fcfa18bebde9fc50db"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ab57b9744531ee0fcfa18bebde9fc50db">isFile</a> () const </td></tr>
  102. <tr class="separator:ab57b9744531ee0fcfa18bebde9fc50db"><td class="memSeparator" colspan="2">&#160;</td></tr>
  103. <tr class="memitem:a0fb6e697de39cdb777744981f58eaaa8"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a0fb6e697de39cdb777744981f58eaaa8">isOpen</a> () const </td></tr>
  104. <tr class="separator:a0fb6e697de39cdb777744981f58eaaa8"><td class="memSeparator" colspan="2">&#160;</td></tr>
  105. <tr class="memitem:ad1fcdcb6c1cb66207d243584e6049095"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ad1fcdcb6c1cb66207d243584e6049095">isRoot</a> () const </td></tr>
  106. <tr class="separator:ad1fcdcb6c1cb66207d243584e6049095"><td class="memSeparator" colspan="2">&#160;</td></tr>
  107. <tr class="memitem:a50023837ddbc57b10098d3a7cd5856f7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a50023837ddbc57b10098d3a7cd5856f7">isSubDir</a> () const </td></tr>
  108. <tr class="separator:a50023837ddbc57b10098d3a7cd5856f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  109. <tr class="memitem:ae94a6672e77325d91cf2ae7077f4c785"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ae94a6672e77325d91cf2ae7077f4c785">ls</a> (Print *pr, uint8_t flags=0, uint8_t indent=0)</td></tr>
  110. <tr class="separator:ae94a6672e77325d91cf2ae7077f4c785"><td class="memSeparator" colspan="2">&#160;</td></tr>
  111. <tr class="memitem:a925b3badddc0f9472730a4ccd4ff7b67"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a925b3badddc0f9472730a4ccd4ff7b67">ls</a> (uint8_t flags=0)</td></tr>
  112. <tr class="separator:a925b3badddc0f9472730a4ccd4ff7b67"><td class="memSeparator" colspan="2">&#160;</td></tr>
  113. <tr class="memitem:ad1de34e5dc5b3a1727208f949b5838e9"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ad1de34e5dc5b3a1727208f949b5838e9">mkdir</a> (<a class="el" href="class_sd_base_file.html">SdBaseFile</a> *dir, const char *path, bool pFlag=true)</td></tr>
  114. <tr class="separator:ad1de34e5dc5b3a1727208f949b5838e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  115. <tr class="memitem:a6ff5b48f672515ec20831583de74407f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a6ff5b48f672515ec20831583de74407f">open</a> (<a class="el" href="class_sd_base_file.html">SdBaseFile</a> *dirFile, uint16_t index, uint8_t oflag)</td></tr>
  116. <tr class="separator:a6ff5b48f672515ec20831583de74407f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  117. <tr class="memitem:a4b88be0d893bcada9b203bdd33fff8e2"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a4b88be0d893bcada9b203bdd33fff8e2">open</a> (<a class="el" href="class_sd_base_file.html">SdBaseFile</a> *dirFile, const char *path, uint8_t oflag)</td></tr>
  118. <tr class="separator:a4b88be0d893bcada9b203bdd33fff8e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  119. <tr class="memitem:a63854cd9c57a9910779ca22112b436e0"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a63854cd9c57a9910779ca22112b436e0">open</a> (const char *path, uint8_t oflag=O_READ)</td></tr>
  120. <tr class="separator:a63854cd9c57a9910779ca22112b436e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  121. <tr class="memitem:aee4c736345e96aa5ddb7e5768ce88f51"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#aee4c736345e96aa5ddb7e5768ce88f51">openNext</a> (<a class="el" href="class_sd_base_file.html">SdBaseFile</a> *dirFile, uint8_t oflag)</td></tr>
  122. <tr class="separator:aee4c736345e96aa5ddb7e5768ce88f51"><td class="memSeparator" colspan="2">&#160;</td></tr>
  123. <tr class="memitem:ac67ffdfb84263bcd425886c09a15e287"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ac67ffdfb84263bcd425886c09a15e287">openRoot</a> (<a class="el" href="class_sd_volume.html">SdVolume</a> *vol)</td></tr>
  124. <tr class="separator:ac67ffdfb84263bcd425886c09a15e287"><td class="memSeparator" colspan="2">&#160;</td></tr>
  125. <tr class="memitem:a996abee868ce928d04d9d0ad9305c915"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a996abee868ce928d04d9d0ad9305c915">peek</a> ()</td></tr>
  126. <tr class="separator:a996abee868ce928d04d9d0ad9305c915"><td class="memSeparator" colspan="2">&#160;</td></tr>
  127. <tr class="memitem:afe2fd8314f3a6c0e06ff178f730efe07"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#afe2fd8314f3a6c0e06ff178f730efe07">printCreateDateTime</a> (Print *pr)</td></tr>
  128. <tr class="separator:afe2fd8314f3a6c0e06ff178f730efe07"><td class="memSeparator" colspan="2">&#160;</td></tr>
  129. <tr class="memitem:aeb099d29e90975736f79fe54a31936b9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#aeb099d29e90975736f79fe54a31936b9">printField</a> (float value, char term, uint8_t prec=2)</td></tr>
  130. <tr class="separator:aeb099d29e90975736f79fe54a31936b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  131. <tr class="memitem:a8fcc3db8e05121c739d8d43ee40fec72"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a8fcc3db8e05121c739d8d43ee40fec72">printField</a> (int16_t value, char term)</td></tr>
  132. <tr class="separator:a8fcc3db8e05121c739d8d43ee40fec72"><td class="memSeparator" colspan="2">&#160;</td></tr>
  133. <tr class="memitem:a71050abe5bed8e44f48ae75627b54c63"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a71050abe5bed8e44f48ae75627b54c63">printField</a> (uint16_t value, char term)</td></tr>
  134. <tr class="separator:a71050abe5bed8e44f48ae75627b54c63"><td class="memSeparator" colspan="2">&#160;</td></tr>
  135. <tr class="memitem:a770817e273c68fb830f9f029c39fc41c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a770817e273c68fb830f9f029c39fc41c">printField</a> (int32_t value, char term)</td></tr>
  136. <tr class="separator:a770817e273c68fb830f9f029c39fc41c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  137. <tr class="memitem:a27146777c4d215cb5887edab4b4599b0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a27146777c4d215cb5887edab4b4599b0">printField</a> (uint32_t value, char term)</td></tr>
  138. <tr class="separator:a27146777c4d215cb5887edab4b4599b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  139. <tr class="memitem:a0591fd1f5abc8d02547451eacd08e804"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a0591fd1f5abc8d02547451eacd08e804">printFileSize</a> (Print *pr)</td></tr>
  140. <tr class="separator:a0591fd1f5abc8d02547451eacd08e804"><td class="memSeparator" colspan="2">&#160;</td></tr>
  141. <tr class="memitem:a65604a3450e69799f2969b6a145647dc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a65604a3450e69799f2969b6a145647dc">printModifyDateTime</a> (Print *pr)</td></tr>
  142. <tr class="separator:a65604a3450e69799f2969b6a145647dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
  143. <tr class="memitem:add1a682e60aa3d8c030805122d5aa4e3"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#add1a682e60aa3d8c030805122d5aa4e3">printName</a> ()</td></tr>
  144. <tr class="separator:add1a682e60aa3d8c030805122d5aa4e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
  145. <tr class="memitem:a942e26db2e764fccaeefea0fb371864d"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a942e26db2e764fccaeefea0fb371864d">printName</a> (Print *pr)</td></tr>
  146. <tr class="separator:a942e26db2e764fccaeefea0fb371864d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  147. <tr class="memitem:a145595e55db1629fa126ffa2628fe9eb"><td class="memItemLeft" align="right" valign="top">int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a145595e55db1629fa126ffa2628fe9eb">read</a> ()</td></tr>
  148. <tr class="separator:a145595e55db1629fa126ffa2628fe9eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
  149. <tr class="memitem:aa70609890c15df7c49d65b07d1161a3f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#aa70609890c15df7c49d65b07d1161a3f">read</a> (void *buf, size_t nbyte)</td></tr>
  150. <tr class="separator:aa70609890c15df7c49d65b07d1161a3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  151. <tr class="memitem:ae5dd9c5f9764db71c90c5fcfb02b2c97"><td class="memItemLeft" align="right" valign="top">int8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ae5dd9c5f9764db71c90c5fcfb02b2c97">readDir</a> (dir_t *dir)</td></tr>
  152. <tr class="separator:ae5dd9c5f9764db71c90c5fcfb02b2c97"><td class="memSeparator" colspan="2">&#160;</td></tr>
  153. <tr class="memitem:a6e88ee210c9bd7556477c0e7ba4de1bb"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a6e88ee210c9bd7556477c0e7ba4de1bb">remove</a> ()</td></tr>
  154. <tr class="separator:a6e88ee210c9bd7556477c0e7ba4de1bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
  155. <tr class="memitem:ad6e9f07c62add23dfe0338bdd0bf2d40"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ad6e9f07c62add23dfe0338bdd0bf2d40">rename</a> (<a class="el" href="class_sd_base_file.html">SdBaseFile</a> *dirFile, const char *newPath)</td></tr>
  156. <tr class="separator:ad6e9f07c62add23dfe0338bdd0bf2d40"><td class="memSeparator" colspan="2">&#160;</td></tr>
  157. <tr class="memitem:a7a5369b40eb15ad26c2e4af5d069c52c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a7a5369b40eb15ad26c2e4af5d069c52c">rewind</a> ()</td></tr>
  158. <tr class="separator:a7a5369b40eb15ad26c2e4af5d069c52c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  159. <tr class="memitem:a7268834187e8216605963f8ae3cf1e6e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a7268834187e8216605963f8ae3cf1e6e">rmdir</a> ()</td></tr>
  160. <tr class="separator:a7268834187e8216605963f8ae3cf1e6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  161. <tr class="memitem:a4186ba79c83005971096966c0fd02d46"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a4186ba79c83005971096966c0fd02d46">rmRfStar</a> ()</td></tr>
  162. <tr class="separator:a4186ba79c83005971096966c0fd02d46"><td class="memSeparator" colspan="2">&#160;</td></tr>
  163. <tr class="memitem:a2806f9763006e9191678b4e33097b47d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a2806f9763006e9191678b4e33097b47d">SdBaseFile</a> ()</td></tr>
  164. <tr class="separator:a2806f9763006e9191678b4e33097b47d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  165. <tr class="memitem:a94d44fc448dc8a06867d490100a57781"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a94d44fc448dc8a06867d490100a57781">SdBaseFile</a> (const char *path, uint8_t oflag)</td></tr>
  166. <tr class="separator:a94d44fc448dc8a06867d490100a57781"><td class="memSeparator" colspan="2">&#160;</td></tr>
  167. <tr class="memitem:ab04ec7e129607973f6e3436f779b6501"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ab04ec7e129607973f6e3436f779b6501">seekCur</a> (int32_t offset)</td></tr>
  168. <tr class="separator:ab04ec7e129607973f6e3436f779b6501"><td class="memSeparator" colspan="2">&#160;</td></tr>
  169. <tr class="memitem:a6f42e496b179dbdd2c09083cfad28613"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a6f42e496b179dbdd2c09083cfad28613">seekEnd</a> (int32_t offset=0)</td></tr>
  170. <tr class="separator:a6f42e496b179dbdd2c09083cfad28613"><td class="memSeparator" colspan="2">&#160;</td></tr>
  171. <tr class="memitem:afe6aeaf0ca7573ceb8bb335c802dab16"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#afe6aeaf0ca7573ceb8bb335c802dab16">seekSet</a> (uint32_t pos)</td></tr>
  172. <tr class="separator:afe6aeaf0ca7573ceb8bb335c802dab16"><td class="memSeparator" colspan="2">&#160;</td></tr>
  173. <tr class="memitem:a71170390855df02c88cbda6e727e9609"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a71170390855df02c88cbda6e727e9609">setpos</a> (<a class="el" href="struct_fat_pos__t.html">FatPos_t</a> *pos)</td></tr>
  174. <tr class="separator:a71170390855df02c88cbda6e727e9609"><td class="memSeparator" colspan="2">&#160;</td></tr>
  175. <tr class="memitem:a292247972772be832f2c6ea166f4049a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a292247972772be832f2c6ea166f4049a">sync</a> ()</td></tr>
  176. <tr class="separator:a292247972772be832f2c6ea166f4049a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  177. <tr class="memitem:adf84a0487f3b45fc183756b9d17141cd"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#adf84a0487f3b45fc183756b9d17141cd">timestamp</a> (<a class="el" href="class_sd_base_file.html">SdBaseFile</a> *file)</td></tr>
  178. <tr class="separator:adf84a0487f3b45fc183756b9d17141cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
  179. <tr class="memitem:ae55ad6000c44fc73e15934381b305dc4"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ae55ad6000c44fc73e15934381b305dc4">timestamp</a> (uint8_t flag, uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second)</td></tr>
  180. <tr class="separator:ae55ad6000c44fc73e15934381b305dc4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  181. <tr class="memitem:a9d1ad1abbd90089f731de81de1708c19"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a9d1ad1abbd90089f731de81de1708c19">truncate</a> (uint32_t size)</td></tr>
  182. <tr class="separator:a9d1ad1abbd90089f731de81de1708c19"><td class="memSeparator" colspan="2">&#160;</td></tr>
  183. <tr class="memitem:a1555e6866abc9c867c5fff189a3a4317"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a1555e6866abc9c867c5fff189a3a4317">type</a> () const </td></tr>
  184. <tr class="separator:a1555e6866abc9c867c5fff189a3a4317"><td class="memSeparator" colspan="2">&#160;</td></tr>
  185. <tr class="memitem:acb021c2b7f68778d683d093775532a06"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_sd_volume.html">SdVolume</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#acb021c2b7f68778d683d093775532a06">volume</a> () const </td></tr>
  186. <tr class="separator:acb021c2b7f68778d683d093775532a06"><td class="memSeparator" colspan="2">&#160;</td></tr>
  187. <tr class="memitem:a874e3bae567f96bed5ad442beb846a61"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a874e3bae567f96bed5ad442beb846a61">write</a> (const void *buf, size_t nbyte)</td></tr>
  188. <tr class="separator:a874e3bae567f96bed5ad442beb846a61"><td class="memSeparator" colspan="2">&#160;</td></tr>
  189. </table><table class="memberdecls">
  190. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
  191. Static Public Member Functions</h2></td></tr>
  192. <tr class="memitem:a56b9402969b3348c97b413750226f955"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_sd_base_file.html">SdBaseFile</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a56b9402969b3348c97b413750226f955">cwd</a> ()</td></tr>
  193. <tr class="separator:a56b9402969b3348c97b413750226f955"><td class="memSeparator" colspan="2">&#160;</td></tr>
  194. <tr class="memitem:a1664a62726dcd7ff82c12d724b3b34df"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a1664a62726dcd7ff82c12d724b3b34df">dateTimeCallback</a> (void(*dateTime)(uint16_t *date, uint16_t *time))</td></tr>
  195. <tr class="separator:a1664a62726dcd7ff82c12d724b3b34df"><td class="memSeparator" colspan="2">&#160;</td></tr>
  196. <tr class="memitem:a04e3e7829c56a6b11df8df0051a49ef9"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a04e3e7829c56a6b11df8df0051a49ef9">dateTimeCallbackCancel</a> ()</td></tr>
  197. <tr class="separator:a04e3e7829c56a6b11df8df0051a49ef9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  198. <tr class="memitem:a8fdbf7893bf19793e772b340e4c08fed"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a8fdbf7893bf19793e772b340e4c08fed">dirName</a> (const dir_t &amp;dir, char *name)</td></tr>
  199. <tr class="separator:a8fdbf7893bf19793e772b340e4c08fed"><td class="memSeparator" colspan="2">&#160;</td></tr>
  200. <tr class="memitem:a1f8b53aea38427dd483dfff4e9437d0c"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a1f8b53aea38427dd483dfff4e9437d0c">printFatDate</a> (uint16_t fatDate)</td></tr>
  201. <tr class="separator:a1f8b53aea38427dd483dfff4e9437d0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  202. <tr class="memitem:a460b641eb358f2d6ac7a937944f9fba4"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a460b641eb358f2d6ac7a937944f9fba4">printFatDate</a> (Print *pr, uint16_t fatDate)</td></tr>
  203. <tr class="separator:a460b641eb358f2d6ac7a937944f9fba4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  204. <tr class="memitem:a9d7dcf89a8d3144731e59ea74a640d68"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a9d7dcf89a8d3144731e59ea74a640d68">printFatTime</a> (uint16_t fatTime)</td></tr>
  205. <tr class="separator:a9d7dcf89a8d3144731e59ea74a640d68"><td class="memSeparator" colspan="2">&#160;</td></tr>
  206. <tr class="memitem:af4d9cedda669bccdc8c8eeea73d04943"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#af4d9cedda669bccdc8c8eeea73d04943">printFatTime</a> (Print *pr, uint16_t fatTime)</td></tr>
  207. <tr class="separator:af4d9cedda669bccdc8c8eeea73d04943"><td class="memSeparator" colspan="2">&#160;</td></tr>
  208. <tr class="memitem:a4951400870f3f5ed8cc3f46b69388ed7"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a4951400870f3f5ed8cc3f46b69388ed7">remove</a> (<a class="el" href="class_sd_base_file.html">SdBaseFile</a> *dirFile, const char *path)</td></tr>
  209. <tr class="separator:a4951400870f3f5ed8cc3f46b69388ed7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  210. </table><table class="memberdecls">
  211. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
  212. Public Attributes</h2></td></tr>
  213. <tr class="memitem:a47d4ba2177ffcd99c2387f9fac182d5b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a47d4ba2177ffcd99c2387f9fac182d5b">writeError</a></td></tr>
  214. <tr class="separator:a47d4ba2177ffcd99c2387f9fac182d5b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  215. </table><table class="memberdecls">
  216. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
  217. Friends</h2></td></tr>
  218. <tr class="memitem:ac838f1e6beb01ec57bd4b52e57df85e7"><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ac838f1e6beb01ec57bd4b52e57df85e7">SdFat</a></td></tr>
  219. <tr class="separator:ac838f1e6beb01ec57bd4b52e57df85e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  220. </table>
  221. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  222. <div class="textblock"><p>Base class for <a class="el" href="class_sd_file.html" title="SdBaseFile with Arduino Stream. ">SdFile</a> with Print and C++ streams. </p>
  223. </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
  224. <a class="anchor" id="a2806f9763006e9191678b4e33097b47d"></a>
  225. <div class="memitem">
  226. <div class="memproto">
  227. <table class="mlabels">
  228. <tr>
  229. <td class="mlabels-left">
  230. <table class="memname">
  231. <tr>
  232. <td class="memname">SdBaseFile::SdBaseFile </td>
  233. <td>(</td>
  234. <td class="paramname"></td><td>)</td>
  235. <td></td>
  236. </tr>
  237. </table>
  238. </td>
  239. <td class="mlabels-right">
  240. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  241. </tr>
  242. </table>
  243. </div><div class="memdoc">
  244. <p>Create an instance. </p>
  245. </div>
  246. </div>
  247. <a class="anchor" id="a94d44fc448dc8a06867d490100a57781"></a>
  248. <div class="memitem">
  249. <div class="memproto">
  250. <table class="memname">
  251. <tr>
  252. <td class="memname">SdBaseFile::SdBaseFile </td>
  253. <td>(</td>
  254. <td class="paramtype">const char *&#160;</td>
  255. <td class="paramname"><em>path</em>, </td>
  256. </tr>
  257. <tr>
  258. <td class="paramkey"></td>
  259. <td></td>
  260. <td class="paramtype">uint8_t&#160;</td>
  261. <td class="paramname"><em>oflag</em>&#160;</td>
  262. </tr>
  263. <tr>
  264. <td></td>
  265. <td>)</td>
  266. <td></td><td></td>
  267. </tr>
  268. </table>
  269. </div><div class="memdoc">
  270. <p>Create a file object and open it in the current working directory.</p>
  271. <dl class="params"><dt>Parameters</dt><dd>
  272. <table class="params">
  273. <tr><td class="paramdir">[in]</td><td class="paramname">path</td><td>A path with a valid 8.3 DOS name for a file to be opened.</td></tr>
  274. <tr><td class="paramdir">[in]</td><td class="paramname">oflag</td><td>Values for <em>oflag</em> are constructed by a bitwise-inclusive OR of open flags. see <a class="el" href="class_sd_base_file.html#a4b88be0d893bcada9b203bdd33fff8e2">SdBaseFile::open(SdBaseFile*, const char*, uint8_t)</a>. </td></tr>
  275. </table>
  276. </dd>
  277. </dl>
  278. </div>
  279. </div>
  280. <h2 class="groupheader">Member Function Documentation</h2>
  281. <a class="anchor" id="ac4381fe633716069f2161d9e9fef5d16"></a>
  282. <div class="memitem">
  283. <div class="memproto">
  284. <table class="mlabels">
  285. <tr>
  286. <td class="mlabels-left">
  287. <table class="memname">
  288. <tr>
  289. <td class="memname">uint32_t SdBaseFile::available </td>
  290. <td>(</td>
  291. <td class="paramname"></td><td>)</td>
  292. <td></td>
  293. </tr>
  294. </table>
  295. </td>
  296. <td class="mlabels-right">
  297. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  298. </tr>
  299. </table>
  300. </div><div class="memdoc">
  301. <dl class="section return"><dt>Returns</dt><dd>number of bytes available from yhe current position to EOF </dd></dl>
  302. </div>
  303. </div>
  304. <a class="anchor" id="a6b4e639ae03ec48c9becd8b472aa1b50"></a>
  305. <div class="memitem">
  306. <div class="memproto">
  307. <table class="mlabels">
  308. <tr>
  309. <td class="mlabels-left">
  310. <table class="memname">
  311. <tr>
  312. <td class="memname">void SdBaseFile::clearWriteError </td>
  313. <td>(</td>
  314. <td class="paramname"></td><td>)</td>
  315. <td></td>
  316. </tr>
  317. </table>
  318. </td>
  319. <td class="mlabels-right">
  320. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  321. </tr>
  322. </table>
  323. </div><div class="memdoc">
  324. <p>Set writeError to zero </p>
  325. </div>
  326. </div>
  327. <a class="anchor" id="a17f7e949aa0f80d89782d8e31f5edc15"></a>
  328. <div class="memitem">
  329. <div class="memproto">
  330. <table class="memname">
  331. <tr>
  332. <td class="memname">bool SdBaseFile::close </td>
  333. <td>(</td>
  334. <td class="paramname"></td><td>)</td>
  335. <td></td>
  336. </tr>
  337. </table>
  338. </div><div class="memdoc">
  339. <p>Close a file and force cached data and directory information to be written to the storage device.</p>
  340. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. Reasons for failure include no file is open or an I/O error. </dd></dl>
  341. </div>
  342. </div>
  343. <a class="anchor" id="a272c68ba97eb5452ce903e6f8d2895a6"></a>
  344. <div class="memitem">
  345. <div class="memproto">
  346. <table class="memname">
  347. <tr>
  348. <td class="memname">bool SdBaseFile::contiguousRange </td>
  349. <td>(</td>
  350. <td class="paramtype">uint32_t *&#160;</td>
  351. <td class="paramname"><em>bgnBlock</em>, </td>
  352. </tr>
  353. <tr>
  354. <td class="paramkey"></td>
  355. <td></td>
  356. <td class="paramtype">uint32_t *&#160;</td>
  357. <td class="paramname"><em>endBlock</em>&#160;</td>
  358. </tr>
  359. <tr>
  360. <td></td>
  361. <td>)</td>
  362. <td></td><td></td>
  363. </tr>
  364. </table>
  365. </div><div class="memdoc">
  366. <p>Check for contiguous file and return its raw block range.</p>
  367. <dl class="params"><dt>Parameters</dt><dd>
  368. <table class="params">
  369. <tr><td class="paramdir">[out]</td><td class="paramname">bgnBlock</td><td>the first block address for the file. </td></tr>
  370. <tr><td class="paramdir">[out]</td><td class="paramname">endBlock</td><td>the last block address for the file.</td></tr>
  371. </table>
  372. </dd>
  373. </dl>
  374. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. Reasons for failure include file is not contiguous, file has zero length or an I/O error occurred. </dd></dl>
  375. </div>
  376. </div>
  377. <a class="anchor" id="ad14a78d348219d6ce096582b6ed74526"></a>
  378. <div class="memitem">
  379. <div class="memproto">
  380. <table class="memname">
  381. <tr>
  382. <td class="memname">bool SdBaseFile::createContiguous </td>
  383. <td>(</td>
  384. <td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> *&#160;</td>
  385. <td class="paramname"><em>dirFile</em>, </td>
  386. </tr>
  387. <tr>
  388. <td class="paramkey"></td>
  389. <td></td>
  390. <td class="paramtype">const char *&#160;</td>
  391. <td class="paramname"><em>path</em>, </td>
  392. </tr>
  393. <tr>
  394. <td class="paramkey"></td>
  395. <td></td>
  396. <td class="paramtype">uint32_t&#160;</td>
  397. <td class="paramname"><em>size</em>&#160;</td>
  398. </tr>
  399. <tr>
  400. <td></td>
  401. <td>)</td>
  402. <td></td><td></td>
  403. </tr>
  404. </table>
  405. </div><div class="memdoc">
  406. <p>Create and open a new contiguous file of a specified size.</p>
  407. <dl class="section note"><dt>Note</dt><dd>This function only supports short DOS 8.3 names. See <a class="el" href="class_sd_base_file.html#a6ff5b48f672515ec20831583de74407f">open()</a> for more information.</dd></dl>
  408. <dl class="params"><dt>Parameters</dt><dd>
  409. <table class="params">
  410. <tr><td class="paramdir">[in]</td><td class="paramname">dirFile</td><td>The directory where the file will be created. </td></tr>
  411. <tr><td class="paramdir">[in]</td><td class="paramname">path</td><td>A path with a valid DOS 8.3 file name. </td></tr>
  412. <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>The desired file size.</td></tr>
  413. </table>
  414. </dd>
  415. </dl>
  416. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. Reasons for failure include <em>path</em> contains an invalid DOS 8.3 file name, the FAT volume has not been initialized, a file is already open, the file already exists, the root directory is full or an I/O error. </dd></dl>
  417. </div>
  418. </div>
  419. <a class="anchor" id="afd2ed78a03600924ef6502a86d7c6291"></a>
  420. <div class="memitem">
  421. <div class="memproto">
  422. <table class="mlabels">
  423. <tr>
  424. <td class="mlabels-left">
  425. <table class="memname">
  426. <tr>
  427. <td class="memname">uint32_t SdBaseFile::curCluster </td>
  428. <td>(</td>
  429. <td class="paramname"></td><td>)</td>
  430. <td> const</td>
  431. </tr>
  432. </table>
  433. </td>
  434. <td class="mlabels-right">
  435. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  436. </tr>
  437. </table>
  438. </div><div class="memdoc">
  439. <dl class="section return"><dt>Returns</dt><dd>The current cluster number for a file or directory. </dd></dl>
  440. </div>
  441. </div>
  442. <a class="anchor" id="a9739ca25a7c804cace68f95c14658c44"></a>
  443. <div class="memitem">
  444. <div class="memproto">
  445. <table class="mlabels">
  446. <tr>
  447. <td class="mlabels-left">
  448. <table class="memname">
  449. <tr>
  450. <td class="memname">uint32_t SdBaseFile::curPosition </td>
  451. <td>(</td>
  452. <td class="paramname"></td><td>)</td>
  453. <td> const</td>
  454. </tr>
  455. </table>
  456. </td>
  457. <td class="mlabels-right">
  458. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  459. </tr>
  460. </table>
  461. </div><div class="memdoc">
  462. <dl class="section return"><dt>Returns</dt><dd>The current position for a file or directory. </dd></dl>
  463. </div>
  464. </div>
  465. <a class="anchor" id="a56b9402969b3348c97b413750226f955"></a>
  466. <div class="memitem">
  467. <div class="memproto">
  468. <table class="mlabels">
  469. <tr>
  470. <td class="mlabels-left">
  471. <table class="memname">
  472. <tr>
  473. <td class="memname">static <a class="el" href="class_sd_base_file.html">SdBaseFile</a>* SdBaseFile::cwd </td>
  474. <td>(</td>
  475. <td class="paramname"></td><td>)</td>
  476. <td></td>
  477. </tr>
  478. </table>
  479. </td>
  480. <td class="mlabels-right">
  481. <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
  482. </tr>
  483. </table>
  484. </div><div class="memdoc">
  485. <dl class="section return"><dt>Returns</dt><dd>Current working directory </dd></dl>
  486. </div>
  487. </div>
  488. <a class="anchor" id="a1664a62726dcd7ff82c12d724b3b34df"></a>
  489. <div class="memitem">
  490. <div class="memproto">
  491. <table class="mlabels">
  492. <tr>
  493. <td class="mlabels-left">
  494. <table class="memname">
  495. <tr>
  496. <td class="memname">static void SdBaseFile::dateTimeCallback </td>
  497. <td>(</td>
  498. <td class="paramtype">void(*)(uint16_t *date, uint16_t *time)&#160;</td>
  499. <td class="paramname"><em>dateTime</em></td><td>)</td>
  500. <td></td>
  501. </tr>
  502. </table>
  503. </td>
  504. <td class="mlabels-right">
  505. <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
  506. </tr>
  507. </table>
  508. </div><div class="memdoc">
  509. <p>Set the date/time callback function</p>
  510. <dl class="params"><dt>Parameters</dt><dd>
  511. <table class="params">
  512. <tr><td class="paramdir">[in]</td><td class="paramname">dateTime</td><td>The user's call back function. The callback function is of the form:</td></tr>
  513. </table>
  514. </dd>
  515. </dl>
  516. <div class="fragment"><div class="line"><span class="keywordtype">void</span> dateTime(uint16_t* date, uint16_t* time) {</div>
  517. <div class="line"> uint16_t year;</div>
  518. <div class="line"> uint8_t month, day, hour, minute, second;</div>
  519. <div class="line"></div>
  520. <div class="line"> <span class="comment">// User gets date and time from GPS or real-time clock here</span></div>
  521. <div class="line"></div>
  522. <div class="line"> <span class="comment">// return date using FAT_DATE macro to format fields</span></div>
  523. <div class="line"> *date = FAT_DATE(year, month, day);</div>
  524. <div class="line"></div>
  525. <div class="line"> <span class="comment">// return time using FAT_TIME macro to format fields</span></div>
  526. <div class="line"> *time = FAT_TIME(hour, minute, second);</div>
  527. <div class="line">}</div>
  528. </div><!-- fragment --><p>Sets the function that is called when a file is created or when a file's directory entry is modified by <a class="el" href="class_sd_base_file.html#a292247972772be832f2c6ea166f4049a">sync()</a>. All timestamps, access, creation, and modify, are set when a file is created. <a class="el" href="class_sd_base_file.html#a292247972772be832f2c6ea166f4049a">sync()</a> maintains the last access date and last modify date/time.</p>
  529. <p>See the <a class="el" href="class_sd_base_file.html#adf84a0487f3b45fc183756b9d17141cd">timestamp()</a> function. </p>
  530. </div>
  531. </div>
  532. <a class="anchor" id="a04e3e7829c56a6b11df8df0051a49ef9"></a>
  533. <div class="memitem">
  534. <div class="memproto">
  535. <table class="mlabels">
  536. <tr>
  537. <td class="mlabels-left">
  538. <table class="memname">
  539. <tr>
  540. <td class="memname">static void SdBaseFile::dateTimeCallbackCancel </td>
  541. <td>(</td>
  542. <td class="paramname"></td><td>)</td>
  543. <td></td>
  544. </tr>
  545. </table>
  546. </td>
  547. <td class="mlabels-right">
  548. <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
  549. </tr>
  550. </table>
  551. </div><div class="memdoc">
  552. <p>Cancel the date/time callback function. </p>
  553. </div>
  554. </div>
  555. <a class="anchor" id="a0977fc620f90e21897eca1fb1c25fdce"></a>
  556. <div class="memitem">
  557. <div class="memproto">
  558. <table class="memname">
  559. <tr>
  560. <td class="memname">bool SdBaseFile::dirEntry </td>
  561. <td>(</td>
  562. <td class="paramtype">dir_t *&#160;</td>
  563. <td class="paramname"><em>dir</em></td><td>)</td>
  564. <td></td>
  565. </tr>
  566. </table>
  567. </div><div class="memdoc">
  568. <p>Return a file's directory entry.</p>
  569. <dl class="params"><dt>Parameters</dt><dd>
  570. <table class="params">
  571. <tr><td class="paramdir">[out]</td><td class="paramname">dir</td><td>Location for return of the file's directory entry.</td></tr>
  572. </table>
  573. </dd>
  574. </dl>
  575. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  576. </div>
  577. </div>
  578. <a class="anchor" id="a8fdbf7893bf19793e772b340e4c08fed"></a>
  579. <div class="memitem">
  580. <div class="memproto">
  581. <table class="mlabels">
  582. <tr>
  583. <td class="mlabels-left">
  584. <table class="memname">
  585. <tr>
  586. <td class="memname">void SdBaseFile::dirName </td>
  587. <td>(</td>
  588. <td class="paramtype">const dir_t &amp;&#160;</td>
  589. <td class="paramname"><em>dir</em>, </td>
  590. </tr>
  591. <tr>
  592. <td class="paramkey"></td>
  593. <td></td>
  594. <td class="paramtype">char *&#160;</td>
  595. <td class="paramname"><em>name</em>&#160;</td>
  596. </tr>
  597. <tr>
  598. <td></td>
  599. <td>)</td>
  600. <td></td><td></td>
  601. </tr>
  602. </table>
  603. </td>
  604. <td class="mlabels-right">
  605. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  606. </tr>
  607. </table>
  608. </div><div class="memdoc">
  609. <p>Format the name field of <em>dir</em> into the 13 byte array <em>name</em> in standard 8.3 short name format.</p>
  610. <dl class="params"><dt>Parameters</dt><dd>
  611. <table class="params">
  612. <tr><td class="paramdir">[in]</td><td class="paramname">dir</td><td>The directory structure containing the name. </td></tr>
  613. <tr><td class="paramdir">[out]</td><td class="paramname">name</td><td>A 13 byte char array for the formatted name. </td></tr>
  614. </table>
  615. </dd>
  616. </dl>
  617. </div>
  618. </div>
  619. <a class="anchor" id="aa0b95ccc568d483f1416d2eacd1ff3f7"></a>
  620. <div class="memitem">
  621. <div class="memproto">
  622. <table class="memname">
  623. <tr>
  624. <td class="memname">bool SdBaseFile::exists </td>
  625. <td>(</td>
  626. <td class="paramtype">const char *&#160;</td>
  627. <td class="paramname"><em>name</em></td><td>)</td>
  628. <td></td>
  629. </tr>
  630. </table>
  631. </div><div class="memdoc">
  632. <p>Test for the existence of a file in a directory</p>
  633. <dl class="params"><dt>Parameters</dt><dd>
  634. <table class="params">
  635. <tr><td class="paramdir">[in]</td><td class="paramname">name</td><td>Name of the file to be tested for.</td></tr>
  636. </table>
  637. </dd>
  638. </dl>
  639. <p>The calling instance must be an open directory file.</p>
  640. <p>dirFile.exists("TOFIND.TXT") searches for "TOFIND.TXT" in the directory dirFile.</p>
  641. <dl class="section return"><dt>Returns</dt><dd>true if the file exists else false. </dd></dl>
  642. </div>
  643. </div>
  644. <a class="anchor" id="a41de4f35c622c1a5f5699400e8d05a87"></a>
  645. <div class="memitem">
  646. <div class="memproto">
  647. <table class="memname">
  648. <tr>
  649. <td class="memname">int16_t SdBaseFile::fgets </td>
  650. <td>(</td>
  651. <td class="paramtype">char *&#160;</td>
  652. <td class="paramname"><em>str</em>, </td>
  653. </tr>
  654. <tr>
  655. <td class="paramkey"></td>
  656. <td></td>
  657. <td class="paramtype">int16_t&#160;</td>
  658. <td class="paramname"><em>num</em>, </td>
  659. </tr>
  660. <tr>
  661. <td class="paramkey"></td>
  662. <td></td>
  663. <td class="paramtype">char *&#160;</td>
  664. <td class="paramname"><em>delim</em> = <code>0</code>&#160;</td>
  665. </tr>
  666. <tr>
  667. <td></td>
  668. <td>)</td>
  669. <td></td><td></td>
  670. </tr>
  671. </table>
  672. </div><div class="memdoc">
  673. <p>Get a string from a file.</p>
  674. <p><a class="el" href="class_sd_base_file.html#a41de4f35c622c1a5f5699400e8d05a87">fgets()</a> reads bytes from a file into the array pointed to by <em>str</em>, until <em>num</em> - 1 bytes are read, or a delimiter is read and transferred to <em>str</em>, or end-of-file is encountered. The string is then terminated with a null byte.</p>
  675. <p><a class="el" href="class_sd_base_file.html#a41de4f35c622c1a5f5699400e8d05a87">fgets()</a> deletes CR, '\r', from the string. This insures only a '\n' terminates the string for Windows text files which use CRLF for newline.</p>
  676. <dl class="params"><dt>Parameters</dt><dd>
  677. <table class="params">
  678. <tr><td class="paramdir">[out]</td><td class="paramname">str</td><td>Pointer to the array where the string is stored. </td></tr>
  679. <tr><td class="paramdir">[in]</td><td class="paramname">num</td><td>Maximum number of characters to be read (including the final null byte). Usually the length of the array <em>str</em> is used. </td></tr>
  680. <tr><td class="paramdir">[in]</td><td class="paramname">delim</td><td>Optional set of delimiters. The default is "\n".</td></tr>
  681. </table>
  682. </dd>
  683. </dl>
  684. <dl class="section return"><dt>Returns</dt><dd>For success <a class="el" href="class_sd_base_file.html#a41de4f35c622c1a5f5699400e8d05a87">fgets()</a> returns the length of the string in <em>str</em>. If no data is read, <a class="el" href="class_sd_base_file.html#a41de4f35c622c1a5f5699400e8d05a87">fgets()</a> returns zero for EOF or -1 if an error occurred. </dd></dl>
  685. </div>
  686. </div>
  687. <a class="anchor" id="a32ac452756fdf80aae75fb1ab093a421"></a>
  688. <div class="memitem">
  689. <div class="memproto">
  690. <table class="mlabels">
  691. <tr>
  692. <td class="mlabels-left">
  693. <table class="memname">
  694. <tr>
  695. <td class="memname">uint32_t SdBaseFile::fileSize </td>
  696. <td>(</td>
  697. <td class="paramname"></td><td>)</td>
  698. <td> const</td>
  699. </tr>
  700. </table>
  701. </td>
  702. <td class="mlabels-right">
  703. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  704. </tr>
  705. </table>
  706. </div><div class="memdoc">
  707. <dl class="section return"><dt>Returns</dt><dd>The total number of bytes in a file or directory. </dd></dl>
  708. </div>
  709. </div>
  710. <a class="anchor" id="adca5f8fce7851f9b7abc92cb73e49e35"></a>
  711. <div class="memitem">
  712. <div class="memproto">
  713. <table class="mlabels">
  714. <tr>
  715. <td class="mlabels-left">
  716. <table class="memname">
  717. <tr>
  718. <td class="memname">uint32_t SdBaseFile::firstCluster </td>
  719. <td>(</td>
  720. <td class="paramname"></td><td>)</td>
  721. <td> const</td>
  722. </tr>
  723. </table>
  724. </td>
  725. <td class="mlabels-right">
  726. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  727. </tr>
  728. </table>
  729. </div><div class="memdoc">
  730. <dl class="section return"><dt>Returns</dt><dd>The first cluster number for a file or directory. </dd></dl>
  731. </div>
  732. </div>
  733. <a class="anchor" id="a2e84ccce858fd7e4d88e26b23d19a822"></a>
  734. <div class="memitem">
  735. <div class="memproto">
  736. <table class="memname">
  737. <tr>
  738. <td class="memname">bool SdBaseFile::getFilename </td>
  739. <td>(</td>
  740. <td class="paramtype">char *&#160;</td>
  741. <td class="paramname"><em>name</em></td><td>)</td>
  742. <td></td>
  743. </tr>
  744. </table>
  745. </div><div class="memdoc">
  746. <p>Get a file's name</p>
  747. <dl class="params"><dt>Parameters</dt><dd>
  748. <table class="params">
  749. <tr><td class="paramdir">[out]</td><td class="paramname">name</td><td>An array of 13 characters for the file's name.</td></tr>
  750. </table>
  751. </dd>
  752. </dl>
  753. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  754. </div>
  755. </div>
  756. <a class="anchor" id="ad1af089e5cf0a4c86e9b6bae1595f59b"></a>
  757. <div class="memitem">
  758. <div class="memproto">
  759. <table class="memname">
  760. <tr>
  761. <td class="memname">void SdBaseFile::getpos </td>
  762. <td>(</td>
  763. <td class="paramtype"><a class="el" href="struct_fat_pos__t.html">FatPos_t</a> *&#160;</td>
  764. <td class="paramname"><em>pos</em></td><td>)</td>
  765. <td></td>
  766. </tr>
  767. </table>
  768. </div><div class="memdoc">
  769. <p>get position for streams </p>
  770. <dl class="params"><dt>Parameters</dt><dd>
  771. <table class="params">
  772. <tr><td class="paramdir">[out]</td><td class="paramname">pos</td><td>struct to receive position </td></tr>
  773. </table>
  774. </dd>
  775. </dl>
  776. </div>
  777. </div>
  778. <a class="anchor" id="aa8ebd3ec28126c3171059d3e7dd355b9"></a>
  779. <div class="memitem">
  780. <div class="memproto">
  781. <table class="mlabels">
  782. <tr>
  783. <td class="mlabels-left">
  784. <table class="memname">
  785. <tr>
  786. <td class="memname">bool SdBaseFile::getWriteError </td>
  787. <td>(</td>
  788. <td class="paramname"></td><td>)</td>
  789. <td></td>
  790. </tr>
  791. </table>
  792. </td>
  793. <td class="mlabels-right">
  794. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  795. </tr>
  796. </table>
  797. </div><div class="memdoc">
  798. <dl class="section return"><dt>Returns</dt><dd>value of writeError </dd></dl>
  799. </div>
  800. </div>
  801. <a class="anchor" id="ad43ed061a1f77578d3c30a0f9b198497"></a>
  802. <div class="memitem">
  803. <div class="memproto">
  804. <table class="mlabels">
  805. <tr>
  806. <td class="mlabels-left">
  807. <table class="memname">
  808. <tr>
  809. <td class="memname">bool SdBaseFile::isDir </td>
  810. <td>(</td>
  811. <td class="paramname"></td><td>)</td>
  812. <td> const</td>
  813. </tr>
  814. </table>
  815. </td>
  816. <td class="mlabels-right">
  817. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  818. </tr>
  819. </table>
  820. </div><div class="memdoc">
  821. <dl class="section return"><dt>Returns</dt><dd>True if this is a directory else false. </dd></dl>
  822. </div>
  823. </div>
  824. <a class="anchor" id="ab57b9744531ee0fcfa18bebde9fc50db"></a>
  825. <div class="memitem">
  826. <div class="memproto">
  827. <table class="mlabels">
  828. <tr>
  829. <td class="mlabels-left">
  830. <table class="memname">
  831. <tr>
  832. <td class="memname">bool SdBaseFile::isFile </td>
  833. <td>(</td>
  834. <td class="paramname"></td><td>)</td>
  835. <td> const</td>
  836. </tr>
  837. </table>
  838. </td>
  839. <td class="mlabels-right">
  840. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  841. </tr>
  842. </table>
  843. </div><div class="memdoc">
  844. <dl class="section return"><dt>Returns</dt><dd>True if this is a normal file else false. </dd></dl>
  845. </div>
  846. </div>
  847. <a class="anchor" id="a0fb6e697de39cdb777744981f58eaaa8"></a>
  848. <div class="memitem">
  849. <div class="memproto">
  850. <table class="mlabels">
  851. <tr>
  852. <td class="mlabels-left">
  853. <table class="memname">
  854. <tr>
  855. <td class="memname">bool SdBaseFile::isOpen </td>
  856. <td>(</td>
  857. <td class="paramname"></td><td>)</td>
  858. <td> const</td>
  859. </tr>
  860. </table>
  861. </td>
  862. <td class="mlabels-right">
  863. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  864. </tr>
  865. </table>
  866. </div><div class="memdoc">
  867. <dl class="section return"><dt>Returns</dt><dd>True if this is an open file/directory else false. </dd></dl>
  868. </div>
  869. </div>
  870. <a class="anchor" id="ad1fcdcb6c1cb66207d243584e6049095"></a>
  871. <div class="memitem">
  872. <div class="memproto">
  873. <table class="mlabels">
  874. <tr>
  875. <td class="mlabels-left">
  876. <table class="memname">
  877. <tr>
  878. <td class="memname">bool SdBaseFile::isRoot </td>
  879. <td>(</td>
  880. <td class="paramname"></td><td>)</td>
  881. <td> const</td>
  882. </tr>
  883. </table>
  884. </td>
  885. <td class="mlabels-right">
  886. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  887. </tr>
  888. </table>
  889. </div><div class="memdoc">
  890. <dl class="section return"><dt>Returns</dt><dd>True if this is the root directory. </dd></dl>
  891. </div>
  892. </div>
  893. <a class="anchor" id="a50023837ddbc57b10098d3a7cd5856f7"></a>
  894. <div class="memitem">
  895. <div class="memproto">
  896. <table class="mlabels">
  897. <tr>
  898. <td class="mlabels-left">
  899. <table class="memname">
  900. <tr>
  901. <td class="memname">bool SdBaseFile::isSubDir </td>
  902. <td>(</td>
  903. <td class="paramname"></td><td>)</td>
  904. <td> const</td>
  905. </tr>
  906. </table>
  907. </td>
  908. <td class="mlabels-right">
  909. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  910. </tr>
  911. </table>
  912. </div><div class="memdoc">
  913. <dl class="section return"><dt>Returns</dt><dd>True if this is a subdirectory else false. </dd></dl>
  914. </div>
  915. </div>
  916. <a class="anchor" id="ae94a6672e77325d91cf2ae7077f4c785"></a>
  917. <div class="memitem">
  918. <div class="memproto">
  919. <table class="memname">
  920. <tr>
  921. <td class="memname">void SdBaseFile::ls </td>
  922. <td>(</td>
  923. <td class="paramtype">Print *&#160;</td>
  924. <td class="paramname"><em>pr</em>, </td>
  925. </tr>
  926. <tr>
  927. <td class="paramkey"></td>
  928. <td></td>
  929. <td class="paramtype">uint8_t&#160;</td>
  930. <td class="paramname"><em>flags</em> = <code>0</code>, </td>
  931. </tr>
  932. <tr>
  933. <td class="paramkey"></td>
  934. <td></td>
  935. <td class="paramtype">uint8_t&#160;</td>
  936. <td class="paramname"><em>indent</em> = <code>0</code>&#160;</td>
  937. </tr>
  938. <tr>
  939. <td></td>
  940. <td>)</td>
  941. <td></td><td></td>
  942. </tr>
  943. </table>
  944. </div><div class="memdoc">
  945. <p>List directory contents.</p>
  946. <dl class="params"><dt>Parameters</dt><dd>
  947. <table class="params">
  948. <tr><td class="paramdir">[in]</td><td class="paramname">pr</td><td>Print stream for list.</td></tr>
  949. <tr><td class="paramdir">[in]</td><td class="paramname">flags</td><td>The inclusive OR of</td></tr>
  950. </table>
  951. </dd>
  952. </dl>
  953. <p>LS_DATE - Print file modification date</p>
  954. <p>LS_SIZE - Print file size.</p>
  955. <p>LS_R - Recursive list of subdirectories.</p>
  956. <dl class="params"><dt>Parameters</dt><dd>
  957. <table class="params">
  958. <tr><td class="paramdir">[in]</td><td class="paramname">indent</td><td>Amount of space before file name. Used for recursive list to indicate subdirectory level. </td></tr>
  959. </table>
  960. </dd>
  961. </dl>
  962. </div>
  963. </div>
  964. <a class="anchor" id="a925b3badddc0f9472730a4ccd4ff7b67"></a>
  965. <div class="memitem">
  966. <div class="memproto">
  967. <table class="memname">
  968. <tr>
  969. <td class="memname">void SdBaseFile::ls </td>
  970. <td>(</td>
  971. <td class="paramtype">uint8_t&#160;</td>
  972. <td class="paramname"><em>flags</em> = <code>0</code></td><td>)</td>
  973. <td></td>
  974. </tr>
  975. </table>
  976. </div><div class="memdoc">
  977. <p>List directory contents to stdOut.</p>
  978. <dl class="params"><dt>Parameters</dt><dd>
  979. <table class="params">
  980. <tr><td class="paramdir">[in]</td><td class="paramname">flags</td><td>The inclusive OR of</td></tr>
  981. </table>
  982. </dd>
  983. </dl>
  984. <p>LS_DATE - Print file modification date</p>
  985. <p>LS_SIZE - Print file size.</p>
  986. <p>LS_R - Recursive list of subdirectories. </p>
  987. </div>
  988. </div>
  989. <a class="anchor" id="ad1de34e5dc5b3a1727208f949b5838e9"></a>
  990. <div class="memitem">
  991. <div class="memproto">
  992. <table class="memname">
  993. <tr>
  994. <td class="memname">bool SdBaseFile::mkdir </td>
  995. <td>(</td>
  996. <td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> *&#160;</td>
  997. <td class="paramname"><em>parent</em>, </td>
  998. </tr>
  999. <tr>
  1000. <td class="paramkey"></td>
  1001. <td></td>
  1002. <td class="paramtype">const char *&#160;</td>
  1003. <td class="paramname"><em>path</em>, </td>
  1004. </tr>
  1005. <tr>
  1006. <td class="paramkey"></td>
  1007. <td></td>
  1008. <td class="paramtype">bool&#160;</td>
  1009. <td class="paramname"><em>pFlag</em> = <code>true</code>&#160;</td>
  1010. </tr>
  1011. <tr>
  1012. <td></td>
  1013. <td>)</td>
  1014. <td></td><td></td>
  1015. </tr>
  1016. </table>
  1017. </div><div class="memdoc">
  1018. <p>Make a new directory.</p>
  1019. <dl class="params"><dt>Parameters</dt><dd>
  1020. <table class="params">
  1021. <tr><td class="paramdir">[in]</td><td class="paramname">parent</td><td>An open <a class="el" href="class_sd_fat.html" title="Integration class for the SdFat library. ">SdFat</a> instance for the directory that will contain the new directory.</td></tr>
  1022. <tr><td class="paramdir">[in]</td><td class="paramname">path</td><td>A path with a valid 8.3 DOS name for the new directory.</td></tr>
  1023. <tr><td class="paramdir">[in]</td><td class="paramname">pFlag</td><td>Create missing parent directories if true.</td></tr>
  1024. </table>
  1025. </dd>
  1026. </dl>
  1027. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. Reasons for failure include this file is already open, <em>parent</em> is not a directory, <em>path</em> is invalid or already exists in <em>parent</em>. </dd></dl>
  1028. </div>
  1029. </div>
  1030. <a class="anchor" id="a6ff5b48f672515ec20831583de74407f"></a>
  1031. <div class="memitem">
  1032. <div class="memproto">
  1033. <table class="memname">
  1034. <tr>
  1035. <td class="memname">bool SdBaseFile::open </td>
  1036. <td>(</td>
  1037. <td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> *&#160;</td>
  1038. <td class="paramname"><em>dirFile</em>, </td>
  1039. </tr>
  1040. <tr>
  1041. <td class="paramkey"></td>
  1042. <td></td>
  1043. <td class="paramtype">uint16_t&#160;</td>
  1044. <td class="paramname"><em>index</em>, </td>
  1045. </tr>
  1046. <tr>
  1047. <td class="paramkey"></td>
  1048. <td></td>
  1049. <td class="paramtype">uint8_t&#160;</td>
  1050. <td class="paramname"><em>oflag</em>&#160;</td>
  1051. </tr>
  1052. <tr>
  1053. <td></td>
  1054. <td>)</td>
  1055. <td></td><td></td>
  1056. </tr>
  1057. </table>
  1058. </div><div class="memdoc">
  1059. <p>Open a file by index.</p>
  1060. <dl class="params"><dt>Parameters</dt><dd>
  1061. <table class="params">
  1062. <tr><td class="paramdir">[in]</td><td class="paramname">dirFile</td><td>An open <a class="el" href="class_sd_fat.html" title="Integration class for the SdFat library. ">SdFat</a> instance for the directory.</td></tr>
  1063. <tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>The <em>index</em> of the directory entry for the file to be opened. The value for <em>index</em> is (directory file position)/32.</td></tr>
  1064. <tr><td class="paramdir">[in]</td><td class="paramname">oflag</td><td>Values for <em>oflag</em> are constructed by a bitwise-inclusive OR of flags O_READ, O_WRITE, O_TRUNC, and O_SYNC.</td></tr>
  1065. </table>
  1066. </dd>
  1067. </dl>
  1068. <p>See <a class="el" href="class_sd_base_file.html#a6ff5b48f672515ec20831583de74407f">open()</a> by path for definition of flags. </p>
  1069. <dl class="section return"><dt>Returns</dt><dd>true for success or false for failure. </dd></dl>
  1070. </div>
  1071. </div>
  1072. <a class="anchor" id="a4b88be0d893bcada9b203bdd33fff8e2"></a>
  1073. <div class="memitem">
  1074. <div class="memproto">
  1075. <table class="memname">
  1076. <tr>
  1077. <td class="memname">bool SdBaseFile::open </td>
  1078. <td>(</td>
  1079. <td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> *&#160;</td>
  1080. <td class="paramname"><em>dirFile</em>, </td>
  1081. </tr>
  1082. <tr>
  1083. <td class="paramkey"></td>
  1084. <td></td>
  1085. <td class="paramtype">const char *&#160;</td>
  1086. <td class="paramname"><em>path</em>, </td>
  1087. </tr>
  1088. <tr>
  1089. <td class="paramkey"></td>
  1090. <td></td>
  1091. <td class="paramtype">uint8_t&#160;</td>
  1092. <td class="paramname"><em>oflag</em>&#160;</td>
  1093. </tr>
  1094. <tr>
  1095. <td></td>
  1096. <td>)</td>
  1097. <td></td><td></td>
  1098. </tr>
  1099. </table>
  1100. </div><div class="memdoc">
  1101. <p>Open a file or directory by name.</p>
  1102. <dl class="params"><dt>Parameters</dt><dd>
  1103. <table class="params">
  1104. <tr><td class="paramdir">[in]</td><td class="paramname">dirFile</td><td>An open <a class="el" href="class_sd_fat.html" title="Integration class for the SdFat library. ">SdFat</a> instance for the directory containing the file to be opened.</td></tr>
  1105. <tr><td class="paramdir">[in]</td><td class="paramname">path</td><td>A path with a valid 8.3 DOS name for a file to be opened.</td></tr>
  1106. <tr><td class="paramdir">[in]</td><td class="paramname">oflag</td><td>Values for <em>oflag</em> are constructed by a bitwise-inclusive OR of flags from the following list</td></tr>
  1107. </table>
  1108. </dd>
  1109. </dl>
  1110. <p>O_READ - Open for reading.</p>
  1111. <p>O_RDONLY - Same as O_READ.</p>
  1112. <p>O_WRITE - Open for writing.</p>
  1113. <p>O_WRONLY - Same as O_WRITE.</p>
  1114. <p>O_RDWR - Open for reading and writing.</p>
  1115. <p>O_APPEND - If set, the file offset shall be set to the end of the file prior to each write.</p>
  1116. <p>O_AT_END - Set the initial position at the end of the file.</p>
  1117. <p>O_CREAT - If the file exists, this flag has no effect except as noted under O_EXCL below. Otherwise, the file shall be created</p>
  1118. <p>O_EXCL - If O_CREAT and O_EXCL are set, <a class="el" href="class_sd_base_file.html#a6ff5b48f672515ec20831583de74407f">open()</a> shall fail if the file exists.</p>
  1119. <p>O_SYNC - Call <a class="el" href="class_sd_base_file.html#a292247972772be832f2c6ea166f4049a">sync()</a> after each write. This flag should not be used with write(uint8_t), write_P(PGM_P), writeln_P(PGM_P), or the Arduino Print class. These functions do character at a time writes so <a class="el" href="class_sd_base_file.html#a292247972772be832f2c6ea166f4049a">sync()</a> will be called after each byte.</p>
  1120. <p>O_TRUNC - If the file exists and is a regular file, and the file is successfully opened and is not read only, its length shall be truncated to 0.</p>
  1121. <p>WARNING: A given file must not be opened by more than one <a class="el" href="class_sd_base_file.html" title="Base class for SdFile with Print and C++ streams. ">SdBaseFile</a> object or file corruption may occur.</p>
  1122. <dl class="section note"><dt>Note</dt><dd>Directory files must be opened read only. Write and truncation is not allowed for directory files.</dd></dl>
  1123. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. Reasons for failure include this file is already open, <em>dirFile</em> is not a directory, <em>path</em> is invalid, the file does not exist or can't be opened in the access mode specified by oflag. </dd></dl>
  1124. </div>
  1125. </div>
  1126. <a class="anchor" id="a63854cd9c57a9910779ca22112b436e0"></a>
  1127. <div class="memitem">
  1128. <div class="memproto">
  1129. <table class="memname">
  1130. <tr>
  1131. <td class="memname">bool SdBaseFile::open </td>
  1132. <td>(</td>
  1133. <td class="paramtype">const char *&#160;</td>
  1134. <td class="paramname"><em>path</em>, </td>
  1135. </tr>
  1136. <tr>
  1137. <td class="paramkey"></td>
  1138. <td></td>
  1139. <td class="paramtype">uint8_t&#160;</td>
  1140. <td class="paramname"><em>oflag</em> = <code>O_READ</code>&#160;</td>
  1141. </tr>
  1142. <tr>
  1143. <td></td>
  1144. <td>)</td>
  1145. <td></td><td></td>
  1146. </tr>
  1147. </table>
  1148. </div><div class="memdoc">
  1149. <p>Open a file in the current working directory.</p>
  1150. <dl class="params"><dt>Parameters</dt><dd>
  1151. <table class="params">
  1152. <tr><td class="paramdir">[in]</td><td class="paramname">path</td><td>A path with a valid 8.3 DOS name for a file to be opened.</td></tr>
  1153. <tr><td class="paramdir">[in]</td><td class="paramname">oflag</td><td>Values for <em>oflag</em> are constructed by a bitwise-inclusive OR of open flags. see <a class="el" href="class_sd_base_file.html#a4b88be0d893bcada9b203bdd33fff8e2">SdBaseFile::open(SdBaseFile*, const char*, uint8_t)</a>.</td></tr>
  1154. </table>
  1155. </dd>
  1156. </dl>
  1157. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  1158. </div>
  1159. </div>
  1160. <a class="anchor" id="aee4c736345e96aa5ddb7e5768ce88f51"></a>
  1161. <div class="memitem">
  1162. <div class="memproto">
  1163. <table class="memname">
  1164. <tr>
  1165. <td class="memname">bool SdBaseFile::openNext </td>
  1166. <td>(</td>
  1167. <td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> *&#160;</td>
  1168. <td class="paramname"><em>dirFile</em>, </td>
  1169. </tr>
  1170. <tr>
  1171. <td class="paramkey"></td>
  1172. <td></td>
  1173. <td class="paramtype">uint8_t&#160;</td>
  1174. <td class="paramname"><em>oflag</em>&#160;</td>
  1175. </tr>
  1176. <tr>
  1177. <td></td>
  1178. <td>)</td>
  1179. <td></td><td></td>
  1180. </tr>
  1181. </table>
  1182. </div><div class="memdoc">
  1183. <p>Open the next file or subdirectory in a directory.</p>
  1184. <dl class="params"><dt>Parameters</dt><dd>
  1185. <table class="params">
  1186. <tr><td class="paramdir">[in]</td><td class="paramname">dirFile</td><td>An open <a class="el" href="class_sd_fat.html" title="Integration class for the SdFat library. ">SdFat</a> instance for the directory containing the file to be opened.</td></tr>
  1187. <tr><td class="paramdir">[in]</td><td class="paramname">oflag</td><td>Values for <em>oflag</em> are constructed by a bitwise-inclusive OR of flags O_READ, O_WRITE, O_TRUNC, and O_SYNC.</td></tr>
  1188. </table>
  1189. </dd>
  1190. </dl>
  1191. <p>See <a class="el" href="class_sd_base_file.html#a6ff5b48f672515ec20831583de74407f">open()</a> by path for definition of flags. </p>
  1192. <dl class="section return"><dt>Returns</dt><dd>true for success or false for failure. </dd></dl>
  1193. </div>
  1194. </div>
  1195. <a class="anchor" id="ac67ffdfb84263bcd425886c09a15e287"></a>
  1196. <div class="memitem">
  1197. <div class="memproto">
  1198. <table class="memname">
  1199. <tr>
  1200. <td class="memname">bool SdBaseFile::openRoot </td>
  1201. <td>(</td>
  1202. <td class="paramtype"><a class="el" href="class_sd_volume.html">SdVolume</a> *&#160;</td>
  1203. <td class="paramname"><em>vol</em></td><td>)</td>
  1204. <td></td>
  1205. </tr>
  1206. </table>
  1207. </div><div class="memdoc">
  1208. <p>Open a volume's root directory.</p>
  1209. <dl class="params"><dt>Parameters</dt><dd>
  1210. <table class="params">
  1211. <tr><td class="paramdir">[in]</td><td class="paramname">vol</td><td>The FAT volume containing the root directory to be opened.</td></tr>
  1212. </table>
  1213. </dd>
  1214. </dl>
  1215. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. Reasons for failure include the file is already open, the FAT volume has not been initialized or it a FAT12 volume. </dd></dl>
  1216. </div>
  1217. </div>
  1218. <a class="anchor" id="a996abee868ce928d04d9d0ad9305c915"></a>
  1219. <div class="memitem">
  1220. <div class="memproto">
  1221. <table class="memname">
  1222. <tr>
  1223. <td class="memname">int SdBaseFile::peek </td>
  1224. <td>(</td>
  1225. <td class="paramname"></td><td>)</td>
  1226. <td></td>
  1227. </tr>
  1228. </table>
  1229. </div><div class="memdoc">
  1230. <p>Return the next available byte without consuming it.</p>
  1231. <dl class="section return"><dt>Returns</dt><dd>The byte if no error and not at eof else -1; </dd></dl>
  1232. </div>
  1233. </div>
  1234. <a class="anchor" id="afe2fd8314f3a6c0e06ff178f730efe07"></a>
  1235. <div class="memitem">
  1236. <div class="memproto">
  1237. <table class="memname">
  1238. <tr>
  1239. <td class="memname">bool SdBaseFile::printCreateDateTime </td>
  1240. <td>(</td>
  1241. <td class="paramtype">Print *&#160;</td>
  1242. <td class="paramname"><em>pr</em></td><td>)</td>
  1243. <td></td>
  1244. </tr>
  1245. </table>
  1246. </div><div class="memdoc">
  1247. <p>Print a file's creation date and time</p>
  1248. <dl class="params"><dt>Parameters</dt><dd>
  1249. <table class="params">
  1250. <tr><td class="paramdir">[in]</td><td class="paramname">pr</td><td>Print stream for output.</td></tr>
  1251. </table>
  1252. </dd>
  1253. </dl>
  1254. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  1255. </div>
  1256. </div>
  1257. <a class="anchor" id="a1f8b53aea38427dd483dfff4e9437d0c"></a>
  1258. <div class="memitem">
  1259. <div class="memproto">
  1260. <table class="mlabels">
  1261. <tr>
  1262. <td class="mlabels-left">
  1263. <table class="memname">
  1264. <tr>
  1265. <td class="memname">void SdBaseFile::printFatDate </td>
  1266. <td>(</td>
  1267. <td class="paramtype">uint16_t&#160;</td>
  1268. <td class="paramname"><em>fatDate</em></td><td>)</td>
  1269. <td></td>
  1270. </tr>
  1271. </table>
  1272. </td>
  1273. <td class="mlabels-right">
  1274. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  1275. </tr>
  1276. </table>
  1277. </div><div class="memdoc">
  1278. <p>Print a directory date field to stdOut.</p>
  1279. <p>Format is yyyy-mm-dd.</p>
  1280. <dl class="params"><dt>Parameters</dt><dd>
  1281. <table class="params">
  1282. <tr><td class="paramdir">[in]</td><td class="paramname">fatDate</td><td>The date field from a directory entry. </td></tr>
  1283. </table>
  1284. </dd>
  1285. </dl>
  1286. </div>
  1287. </div>
  1288. <a class="anchor" id="a460b641eb358f2d6ac7a937944f9fba4"></a>
  1289. <div class="memitem">
  1290. <div class="memproto">
  1291. <table class="mlabels">
  1292. <tr>
  1293. <td class="mlabels-left">
  1294. <table class="memname">
  1295. <tr>
  1296. <td class="memname">void SdBaseFile::printFatDate </td>
  1297. <td>(</td>
  1298. <td class="paramtype">Print *&#160;</td>
  1299. <td class="paramname"><em>pr</em>, </td>
  1300. </tr>
  1301. <tr>
  1302. <td class="paramkey"></td>
  1303. <td></td>
  1304. <td class="paramtype">uint16_t&#160;</td>
  1305. <td class="paramname"><em>fatDate</em>&#160;</td>
  1306. </tr>
  1307. <tr>
  1308. <td></td>
  1309. <td>)</td>
  1310. <td></td><td></td>
  1311. </tr>
  1312. </table>
  1313. </td>
  1314. <td class="mlabels-right">
  1315. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  1316. </tr>
  1317. </table>
  1318. </div><div class="memdoc">
  1319. <p>Print a directory date field.</p>
  1320. <p>Format is yyyy-mm-dd.</p>
  1321. <dl class="params"><dt>Parameters</dt><dd>
  1322. <table class="params">
  1323. <tr><td class="paramdir">[in]</td><td class="paramname">pr</td><td>Print stream for output. </td></tr>
  1324. <tr><td class="paramdir">[in]</td><td class="paramname">fatDate</td><td>The date field from a directory entry. </td></tr>
  1325. </table>
  1326. </dd>
  1327. </dl>
  1328. </div>
  1329. </div>
  1330. <a class="anchor" id="a9d7dcf89a8d3144731e59ea74a640d68"></a>
  1331. <div class="memitem">
  1332. <div class="memproto">
  1333. <table class="mlabels">
  1334. <tr>
  1335. <td class="mlabels-left">
  1336. <table class="memname">
  1337. <tr>
  1338. <td class="memname">void SdBaseFile::printFatTime </td>
  1339. <td>(</td>
  1340. <td class="paramtype">uint16_t&#160;</td>
  1341. <td class="paramname"><em>fatTime</em></td><td>)</td>
  1342. <td></td>
  1343. </tr>
  1344. </table>
  1345. </td>
  1346. <td class="mlabels-right">
  1347. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  1348. </tr>
  1349. </table>
  1350. </div><div class="memdoc">
  1351. <p>Print a directory time field to stdOut.</p>
  1352. <p>Format is hh:mm:ss.</p>
  1353. <dl class="params"><dt>Parameters</dt><dd>
  1354. <table class="params">
  1355. <tr><td class="paramdir">[in]</td><td class="paramname">fatTime</td><td>The time field from a directory entry. </td></tr>
  1356. </table>
  1357. </dd>
  1358. </dl>
  1359. </div>
  1360. </div>
  1361. <a class="anchor" id="af4d9cedda669bccdc8c8eeea73d04943"></a>
  1362. <div class="memitem">
  1363. <div class="memproto">
  1364. <table class="mlabels">
  1365. <tr>
  1366. <td class="mlabels-left">
  1367. <table class="memname">
  1368. <tr>
  1369. <td class="memname">void SdBaseFile::printFatTime </td>
  1370. <td>(</td>
  1371. <td class="paramtype">Print *&#160;</td>
  1372. <td class="paramname"><em>pr</em>, </td>
  1373. </tr>
  1374. <tr>
  1375. <td class="paramkey"></td>
  1376. <td></td>
  1377. <td class="paramtype">uint16_t&#160;</td>
  1378. <td class="paramname"><em>fatTime</em>&#160;</td>
  1379. </tr>
  1380. <tr>
  1381. <td></td>
  1382. <td>)</td>
  1383. <td></td><td></td>
  1384. </tr>
  1385. </table>
  1386. </td>
  1387. <td class="mlabels-right">
  1388. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  1389. </tr>
  1390. </table>
  1391. </div><div class="memdoc">
  1392. <p>Print a directory time field.</p>
  1393. <p>Format is hh:mm:ss.</p>
  1394. <dl class="params"><dt>Parameters</dt><dd>
  1395. <table class="params">
  1396. <tr><td class="paramdir">[in]</td><td class="paramname">pr</td><td>Print stream for output. </td></tr>
  1397. <tr><td class="paramdir">[in]</td><td class="paramname">fatTime</td><td>The time field from a directory entry. </td></tr>
  1398. </table>
  1399. </dd>
  1400. </dl>
  1401. </div>
  1402. </div>
  1403. <a class="anchor" id="aeb099d29e90975736f79fe54a31936b9"></a>
  1404. <div class="memitem">
  1405. <div class="memproto">
  1406. <table class="memname">
  1407. <tr>
  1408. <td class="memname">int SdBaseFile::printField </td>
  1409. <td>(</td>
  1410. <td class="paramtype">float&#160;</td>
  1411. <td class="paramname"><em>value</em>, </td>
  1412. </tr>
  1413. <tr>
  1414. <td class="paramkey"></td>
  1415. <td></td>
  1416. <td class="paramtype">char&#160;</td>
  1417. <td class="paramname"><em>term</em>, </td>
  1418. </tr>
  1419. <tr>
  1420. <td class="paramkey"></td>
  1421. <td></td>
  1422. <td class="paramtype">uint8_t&#160;</td>
  1423. <td class="paramname"><em>prec</em> = <code>2</code>&#160;</td>
  1424. </tr>
  1425. <tr>
  1426. <td></td>
  1427. <td>)</td>
  1428. <td></td><td></td>
  1429. </tr>
  1430. </table>
  1431. </div><div class="memdoc">
  1432. <p>Print a number followed by a field terminator. </p>
  1433. <dl class="params"><dt>Parameters</dt><dd>
  1434. <table class="params">
  1435. <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The number to be printed. </td></tr>
  1436. <tr><td class="paramdir">[in]</td><td class="paramname">term</td><td>The field terminator. Use '\n' for CR LF. </td></tr>
  1437. <tr><td class="paramdir">[in]</td><td class="paramname">prec</td><td>Number of digits after decimal point. </td></tr>
  1438. </table>
  1439. </dd>
  1440. </dl>
  1441. <dl class="section return"><dt>Returns</dt><dd>The number of bytes written or -1 if an error occurs. </dd></dl>
  1442. </div>
  1443. </div>
  1444. <a class="anchor" id="a8fcc3db8e05121c739d8d43ee40fec72"></a>
  1445. <div class="memitem">
  1446. <div class="memproto">
  1447. <table class="memname">
  1448. <tr>
  1449. <td class="memname">int SdBaseFile::printField </td>
  1450. <td>(</td>
  1451. <td class="paramtype">int16_t&#160;</td>
  1452. <td class="paramname"><em>value</em>, </td>
  1453. </tr>
  1454. <tr>
  1455. <td class="paramkey"></td>
  1456. <td></td>
  1457. <td class="paramtype">char&#160;</td>
  1458. <td class="paramname"><em>term</em>&#160;</td>
  1459. </tr>
  1460. <tr>
  1461. <td></td>
  1462. <td>)</td>
  1463. <td></td><td></td>
  1464. </tr>
  1465. </table>
  1466. </div><div class="memdoc">
  1467. <p>Print a number followed by a field terminator. </p>
  1468. <dl class="params"><dt>Parameters</dt><dd>
  1469. <table class="params">
  1470. <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The number to be printed. </td></tr>
  1471. <tr><td class="paramdir">[in]</td><td class="paramname">term</td><td>The field terminator. Use '\n' for CR LF. </td></tr>
  1472. </table>
  1473. </dd>
  1474. </dl>
  1475. <dl class="section return"><dt>Returns</dt><dd>The number of bytes written or -1 if an error occurs. </dd></dl>
  1476. </div>
  1477. </div>
  1478. <a class="anchor" id="a71050abe5bed8e44f48ae75627b54c63"></a>
  1479. <div class="memitem">
  1480. <div class="memproto">
  1481. <table class="memname">
  1482. <tr>
  1483. <td class="memname">int SdBaseFile::printField </td>
  1484. <td>(</td>
  1485. <td class="paramtype">uint16_t&#160;</td>
  1486. <td class="paramname"><em>value</em>, </td>
  1487. </tr>
  1488. <tr>
  1489. <td class="paramkey"></td>
  1490. <td></td>
  1491. <td class="paramtype">char&#160;</td>
  1492. <td class="paramname"><em>term</em>&#160;</td>
  1493. </tr>
  1494. <tr>
  1495. <td></td>
  1496. <td>)</td>
  1497. <td></td><td></td>
  1498. </tr>
  1499. </table>
  1500. </div><div class="memdoc">
  1501. <p>Print a number followed by a field terminator. </p>
  1502. <dl class="params"><dt>Parameters</dt><dd>
  1503. <table class="params">
  1504. <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The number to be printed. </td></tr>
  1505. <tr><td class="paramdir">[in]</td><td class="paramname">term</td><td>The field terminator. Use '\n' for CR LF. </td></tr>
  1506. </table>
  1507. </dd>
  1508. </dl>
  1509. <dl class="section return"><dt>Returns</dt><dd>The number of bytes written or -1 if an error occurs. </dd></dl>
  1510. </div>
  1511. </div>
  1512. <a class="anchor" id="a770817e273c68fb830f9f029c39fc41c"></a>
  1513. <div class="memitem">
  1514. <div class="memproto">
  1515. <table class="memname">
  1516. <tr>
  1517. <td class="memname">int SdBaseFile::printField </td>
  1518. <td>(</td>
  1519. <td class="paramtype">int32_t&#160;</td>
  1520. <td class="paramname"><em>value</em>, </td>
  1521. </tr>
  1522. <tr>
  1523. <td class="paramkey"></td>
  1524. <td></td>
  1525. <td class="paramtype">char&#160;</td>
  1526. <td class="paramname"><em>term</em>&#160;</td>
  1527. </tr>
  1528. <tr>
  1529. <td></td>
  1530. <td>)</td>
  1531. <td></td><td></td>
  1532. </tr>
  1533. </table>
  1534. </div><div class="memdoc">
  1535. <p>Print a number followed by a field terminator. </p>
  1536. <dl class="params"><dt>Parameters</dt><dd>
  1537. <table class="params">
  1538. <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The number to be printed. </td></tr>
  1539. <tr><td class="paramdir">[in]</td><td class="paramname">term</td><td>The field terminator. Use '\n' for CR LF. </td></tr>
  1540. </table>
  1541. </dd>
  1542. </dl>
  1543. <dl class="section return"><dt>Returns</dt><dd>The number of bytes written or -1 if an error occurs. </dd></dl>
  1544. </div>
  1545. </div>
  1546. <a class="anchor" id="a27146777c4d215cb5887edab4b4599b0"></a>
  1547. <div class="memitem">
  1548. <div class="memproto">
  1549. <table class="memname">
  1550. <tr>
  1551. <td class="memname">int SdBaseFile::printField </td>
  1552. <td>(</td>
  1553. <td class="paramtype">uint32_t&#160;</td>
  1554. <td class="paramname"><em>value</em>, </td>
  1555. </tr>
  1556. <tr>
  1557. <td class="paramkey"></td>
  1558. <td></td>
  1559. <td class="paramtype">char&#160;</td>
  1560. <td class="paramname"><em>term</em>&#160;</td>
  1561. </tr>
  1562. <tr>
  1563. <td></td>
  1564. <td>)</td>
  1565. <td></td><td></td>
  1566. </tr>
  1567. </table>
  1568. </div><div class="memdoc">
  1569. <p>Print a number followed by a field terminator. </p>
  1570. <dl class="params"><dt>Parameters</dt><dd>
  1571. <table class="params">
  1572. <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The number to be printed. </td></tr>
  1573. <tr><td class="paramdir">[in]</td><td class="paramname">term</td><td>The field terminator. Use '\n' for CR LF. </td></tr>
  1574. </table>
  1575. </dd>
  1576. </dl>
  1577. <dl class="section return"><dt>Returns</dt><dd>The number of bytes written or -1 if an error occurs. </dd></dl>
  1578. </div>
  1579. </div>
  1580. <a class="anchor" id="a0591fd1f5abc8d02547451eacd08e804"></a>
  1581. <div class="memitem">
  1582. <div class="memproto">
  1583. <table class="memname">
  1584. <tr>
  1585. <td class="memname">size_t SdBaseFile::printFileSize </td>
  1586. <td>(</td>
  1587. <td class="paramtype">Print *&#160;</td>
  1588. <td class="paramname"><em>pr</em></td><td>)</td>
  1589. <td></td>
  1590. </tr>
  1591. </table>
  1592. </div><div class="memdoc">
  1593. </div>
  1594. </div>
  1595. <a class="anchor" id="a65604a3450e69799f2969b6a145647dc"></a>
  1596. <div class="memitem">
  1597. <div class="memproto">
  1598. <table class="memname">
  1599. <tr>
  1600. <td class="memname">bool SdBaseFile::printModifyDateTime </td>
  1601. <td>(</td>
  1602. <td class="paramtype">Print *&#160;</td>
  1603. <td class="paramname"><em>pr</em></td><td>)</td>
  1604. <td></td>
  1605. </tr>
  1606. </table>
  1607. </div><div class="memdoc">
  1608. <p>Print a file's modify date and time</p>
  1609. <dl class="params"><dt>Parameters</dt><dd>
  1610. <table class="params">
  1611. <tr><td class="paramdir">[in]</td><td class="paramname">pr</td><td>Print stream for output.</td></tr>
  1612. </table>
  1613. </dd>
  1614. </dl>
  1615. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  1616. </div>
  1617. </div>
  1618. <a class="anchor" id="add1a682e60aa3d8c030805122d5aa4e3"></a>
  1619. <div class="memitem">
  1620. <div class="memproto">
  1621. <table class="memname">
  1622. <tr>
  1623. <td class="memname">size_t SdBaseFile::printName </td>
  1624. <td>(</td>
  1625. <td class="paramname"></td><td>)</td>
  1626. <td></td>
  1627. </tr>
  1628. </table>
  1629. </div><div class="memdoc">
  1630. <p>Print a file's name to stdOut</p>
  1631. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  1632. </div>
  1633. </div>
  1634. <a class="anchor" id="a942e26db2e764fccaeefea0fb371864d"></a>
  1635. <div class="memitem">
  1636. <div class="memproto">
  1637. <table class="memname">
  1638. <tr>
  1639. <td class="memname">size_t SdBaseFile::printName </td>
  1640. <td>(</td>
  1641. <td class="paramtype">Print *&#160;</td>
  1642. <td class="paramname"><em>pr</em></td><td>)</td>
  1643. <td></td>
  1644. </tr>
  1645. </table>
  1646. </div><div class="memdoc">
  1647. <p>Print a file's name</p>
  1648. <dl class="params"><dt>Parameters</dt><dd>
  1649. <table class="params">
  1650. <tr><td class="paramdir">[in]</td><td class="paramname">pr</td><td>Print stream for output.</td></tr>
  1651. </table>
  1652. </dd>
  1653. </dl>
  1654. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  1655. </div>
  1656. </div>
  1657. <a class="anchor" id="a145595e55db1629fa126ffa2628fe9eb"></a>
  1658. <div class="memitem">
  1659. <div class="memproto">
  1660. <table class="memname">
  1661. <tr>
  1662. <td class="memname">int16_t SdBaseFile::read </td>
  1663. <td>(</td>
  1664. <td class="paramname"></td><td>)</td>
  1665. <td></td>
  1666. </tr>
  1667. </table>
  1668. </div><div class="memdoc">
  1669. <p>Read the next byte from a file.</p>
  1670. <dl class="section return"><dt>Returns</dt><dd>For success read returns the next byte in the file as an int. If an error occurs or end of file is reached -1 is returned. </dd></dl>
  1671. </div>
  1672. </div>
  1673. <a class="anchor" id="aa70609890c15df7c49d65b07d1161a3f"></a>
  1674. <div class="memitem">
  1675. <div class="memproto">
  1676. <table class="memname">
  1677. <tr>
  1678. <td class="memname">int SdBaseFile::read </td>
  1679. <td>(</td>
  1680. <td class="paramtype">void *&#160;</td>
  1681. <td class="paramname"><em>buf</em>, </td>
  1682. </tr>
  1683. <tr>
  1684. <td class="paramkey"></td>
  1685. <td></td>
  1686. <td class="paramtype">size_t&#160;</td>
  1687. <td class="paramname"><em>nbyte</em>&#160;</td>
  1688. </tr>
  1689. <tr>
  1690. <td></td>
  1691. <td>)</td>
  1692. <td></td><td></td>
  1693. </tr>
  1694. </table>
  1695. </div><div class="memdoc">
  1696. <p>Read data from a file starting at the current position.</p>
  1697. <dl class="params"><dt>Parameters</dt><dd>
  1698. <table class="params">
  1699. <tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>Pointer to the location that will receive the data.</td></tr>
  1700. <tr><td class="paramdir">[in]</td><td class="paramname">nbyte</td><td>Maximum number of bytes to read.</td></tr>
  1701. </table>
  1702. </dd>
  1703. </dl>
  1704. <dl class="section return"><dt>Returns</dt><dd>For success <a class="el" href="class_sd_base_file.html#a145595e55db1629fa126ffa2628fe9eb">read()</a> returns the number of bytes read. A value less than <em>nbyte</em>, including zero, will be returned if end of file is reached. If an error occurs, <a class="el" href="class_sd_base_file.html#a145595e55db1629fa126ffa2628fe9eb">read()</a> returns -1. Possible errors include <a class="el" href="class_sd_base_file.html#a145595e55db1629fa126ffa2628fe9eb">read()</a> called before a file has been opened, corrupt file system or an I/O error occurred. </dd></dl>
  1705. </div>
  1706. </div>
  1707. <a class="anchor" id="ae5dd9c5f9764db71c90c5fcfb02b2c97"></a>
  1708. <div class="memitem">
  1709. <div class="memproto">
  1710. <table class="memname">
  1711. <tr>
  1712. <td class="memname">int8_t SdBaseFile::readDir </td>
  1713. <td>(</td>
  1714. <td class="paramtype">dir_t *&#160;</td>
  1715. <td class="paramname"><em>dir</em></td><td>)</td>
  1716. <td></td>
  1717. </tr>
  1718. </table>
  1719. </div><div class="memdoc">
  1720. <p>Read the next directory entry from a directory file.</p>
  1721. <dl class="params"><dt>Parameters</dt><dd>
  1722. <table class="params">
  1723. <tr><td class="paramdir">[out]</td><td class="paramname">dir</td><td>The dir_t struct that will receive the data.</td></tr>
  1724. </table>
  1725. </dd>
  1726. </dl>
  1727. <dl class="section return"><dt>Returns</dt><dd>For success <a class="el" href="class_sd_base_file.html#ae5dd9c5f9764db71c90c5fcfb02b2c97">readDir()</a> returns the number of bytes read. A value of zero will be returned if end of file is reached. If an error occurs, <a class="el" href="class_sd_base_file.html#ae5dd9c5f9764db71c90c5fcfb02b2c97">readDir()</a> returns -1. Possible errors include <a class="el" href="class_sd_base_file.html#ae5dd9c5f9764db71c90c5fcfb02b2c97">readDir()</a> called before a directory has been opened, this is not a directory file or an I/O error occurred. </dd></dl>
  1728. </div>
  1729. </div>
  1730. <a class="anchor" id="a4951400870f3f5ed8cc3f46b69388ed7"></a>
  1731. <div class="memitem">
  1732. <div class="memproto">
  1733. <table class="mlabels">
  1734. <tr>
  1735. <td class="mlabels-left">
  1736. <table class="memname">
  1737. <tr>
  1738. <td class="memname">bool SdBaseFile::remove </td>
  1739. <td>(</td>
  1740. <td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> *&#160;</td>
  1741. <td class="paramname"><em>dirFile</em>, </td>
  1742. </tr>
  1743. <tr>
  1744. <td class="paramkey"></td>
  1745. <td></td>
  1746. <td class="paramtype">const char *&#160;</td>
  1747. <td class="paramname"><em>path</em>&#160;</td>
  1748. </tr>
  1749. <tr>
  1750. <td></td>
  1751. <td>)</td>
  1752. <td></td><td></td>
  1753. </tr>
  1754. </table>
  1755. </td>
  1756. <td class="mlabels-right">
  1757. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  1758. </tr>
  1759. </table>
  1760. </div><div class="memdoc">
  1761. <p>Remove a file.</p>
  1762. <p>The directory entry and all data for the file are deleted.</p>
  1763. <dl class="params"><dt>Parameters</dt><dd>
  1764. <table class="params">
  1765. <tr><td class="paramdir">[in]</td><td class="paramname">dirFile</td><td>The directory that contains the file. </td></tr>
  1766. <tr><td class="paramdir">[in]</td><td class="paramname">path</td><td>Path for the file to be removed.</td></tr>
  1767. </table>
  1768. </dd>
  1769. </dl>
  1770. <dl class="section note"><dt>Note</dt><dd>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".</dd></dl>
  1771. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. Reasons for failure include the file is a directory, is read only, <em>dirFile</em> is not a directory, <em>path</em> is not found or an I/O error occurred. </dd></dl>
  1772. </div>
  1773. </div>
  1774. <a class="anchor" id="a6e88ee210c9bd7556477c0e7ba4de1bb"></a>
  1775. <div class="memitem">
  1776. <div class="memproto">
  1777. <table class="memname">
  1778. <tr>
  1779. <td class="memname">bool SdBaseFile::remove </td>
  1780. <td>(</td>
  1781. <td class="paramname"></td><td>)</td>
  1782. <td></td>
  1783. </tr>
  1784. </table>
  1785. </div><div class="memdoc">
  1786. <p>Remove a file.</p>
  1787. <p>The directory entry and all data for the file are deleted.</p>
  1788. <dl class="section note"><dt>Note</dt><dd>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".</dd></dl>
  1789. <dl class="section return"><dt>Returns</dt><dd>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. </dd></dl>
  1790. </div>
  1791. </div>
  1792. <a class="anchor" id="ad6e9f07c62add23dfe0338bdd0bf2d40"></a>
  1793. <div class="memitem">
  1794. <div class="memproto">
  1795. <table class="memname">
  1796. <tr>
  1797. <td class="memname">bool SdBaseFile::rename </td>
  1798. <td>(</td>
  1799. <td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> *&#160;</td>
  1800. <td class="paramname"><em>dirFile</em>, </td>
  1801. </tr>
  1802. <tr>
  1803. <td class="paramkey"></td>
  1804. <td></td>
  1805. <td class="paramtype">const char *&#160;</td>
  1806. <td class="paramname"><em>newPath</em>&#160;</td>
  1807. </tr>
  1808. <tr>
  1809. <td></td>
  1810. <td>)</td>
  1811. <td></td><td></td>
  1812. </tr>
  1813. </table>
  1814. </div><div class="memdoc">
  1815. <p>Rename a file or subdirectory.</p>
  1816. <dl class="params"><dt>Parameters</dt><dd>
  1817. <table class="params">
  1818. <tr><td class="paramdir">[in]</td><td class="paramname">dirFile</td><td>Directory for the new path. </td></tr>
  1819. <tr><td class="paramdir">[in]</td><td class="paramname">newPath</td><td>New path name for the file/directory.</td></tr>
  1820. </table>
  1821. </dd>
  1822. </dl>
  1823. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. Reasons for failure include <em>dirFile</em> is not open or is not a directory file, newPath is invalid or already exists, or an I/O error occurs. </dd></dl>
  1824. </div>
  1825. </div>
  1826. <a class="anchor" id="a7a5369b40eb15ad26c2e4af5d069c52c"></a>
  1827. <div class="memitem">
  1828. <div class="memproto">
  1829. <table class="mlabels">
  1830. <tr>
  1831. <td class="mlabels-left">
  1832. <table class="memname">
  1833. <tr>
  1834. <td class="memname">void SdBaseFile::rewind </td>
  1835. <td>(</td>
  1836. <td class="paramname"></td><td>)</td>
  1837. <td></td>
  1838. </tr>
  1839. </table>
  1840. </td>
  1841. <td class="mlabels-right">
  1842. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  1843. </tr>
  1844. </table>
  1845. </div><div class="memdoc">
  1846. <p>Set the file's current position to zero. </p>
  1847. </div>
  1848. </div>
  1849. <a class="anchor" id="a7268834187e8216605963f8ae3cf1e6e"></a>
  1850. <div class="memitem">
  1851. <div class="memproto">
  1852. <table class="memname">
  1853. <tr>
  1854. <td class="memname">bool SdBaseFile::rmdir </td>
  1855. <td>(</td>
  1856. <td class="paramname"></td><td>)</td>
  1857. <td></td>
  1858. </tr>
  1859. </table>
  1860. </div><div class="memdoc">
  1861. <p>Remove a directory file.</p>
  1862. <p>The directory file will be removed only if it is empty and is not the root directory. <a class="el" href="class_sd_base_file.html#a7268834187e8216605963f8ae3cf1e6e">rmdir()</a> follows DOS and Windows and ignores the read-only attribute for the directory.</p>
  1863. <dl class="section note"><dt>Note</dt><dd>This function should not be used to delete the 8.3 version of a directory that has a long name. For example if a directory has the long name "New folder" you should not delete the 8.3 name "NEWFOL~1".</dd></dl>
  1864. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. Reasons for failure include the file is not a directory, is the root directory, is not empty, or an I/O error occurred. </dd></dl>
  1865. </div>
  1866. </div>
  1867. <a class="anchor" id="a4186ba79c83005971096966c0fd02d46"></a>
  1868. <div class="memitem">
  1869. <div class="memproto">
  1870. <table class="memname">
  1871. <tr>
  1872. <td class="memname">bool SdBaseFile::rmRfStar </td>
  1873. <td>(</td>
  1874. <td class="paramname"></td><td>)</td>
  1875. <td></td>
  1876. </tr>
  1877. </table>
  1878. </div><div class="memdoc">
  1879. <p>Recursively delete a directory and all contained files.</p>
  1880. <p>This is like the Unix/Linux 'rm -rf *' if called with the root directory hence the name.</p>
  1881. <p>Warning - This will remove all contents of the directory including subdirectories. The directory will then be removed if it is not root. The read-only attribute for files will be ignored.</p>
  1882. <dl class="section note"><dt>Note</dt><dd>This function should not be used to delete the 8.3 version of a directory that has a long name. See <a class="el" href="class_sd_base_file.html#a6e88ee210c9bd7556477c0e7ba4de1bb">remove()</a> and <a class="el" href="class_sd_base_file.html#a7268834187e8216605963f8ae3cf1e6e">rmdir()</a>.</dd></dl>
  1883. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  1884. </div>
  1885. </div>
  1886. <a class="anchor" id="ab04ec7e129607973f6e3436f779b6501"></a>
  1887. <div class="memitem">
  1888. <div class="memproto">
  1889. <table class="mlabels">
  1890. <tr>
  1891. <td class="mlabels-left">
  1892. <table class="memname">
  1893. <tr>
  1894. <td class="memname">bool SdBaseFile::seekCur </td>
  1895. <td>(</td>
  1896. <td class="paramtype">int32_t&#160;</td>
  1897. <td class="paramname"><em>offset</em></td><td>)</td>
  1898. <td></td>
  1899. </tr>
  1900. </table>
  1901. </td>
  1902. <td class="mlabels-right">
  1903. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  1904. </tr>
  1905. </table>
  1906. </div><div class="memdoc">
  1907. <p>Set the files position to current position + <em>pos</em>. See <a class="el" href="class_sd_base_file.html#afe6aeaf0ca7573ceb8bb335c802dab16">seekSet()</a>. </p>
  1908. <dl class="params"><dt>Parameters</dt><dd>
  1909. <table class="params">
  1910. <tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>The new position in bytes from the current position. </td></tr>
  1911. </table>
  1912. </dd>
  1913. </dl>
  1914. <dl class="section return"><dt>Returns</dt><dd>true for success or false for failure. </dd></dl>
  1915. </div>
  1916. </div>
  1917. <a class="anchor" id="a6f42e496b179dbdd2c09083cfad28613"></a>
  1918. <div class="memitem">
  1919. <div class="memproto">
  1920. <table class="mlabels">
  1921. <tr>
  1922. <td class="mlabels-left">
  1923. <table class="memname">
  1924. <tr>
  1925. <td class="memname">bool SdBaseFile::seekEnd </td>
  1926. <td>(</td>
  1927. <td class="paramtype">int32_t&#160;</td>
  1928. <td class="paramname"><em>offset</em> = <code>0</code></td><td>)</td>
  1929. <td></td>
  1930. </tr>
  1931. </table>
  1932. </td>
  1933. <td class="mlabels-right">
  1934. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  1935. </tr>
  1936. </table>
  1937. </div><div class="memdoc">
  1938. <p>Set the files position to end-of-file + <em>offset</em>. See <a class="el" href="class_sd_base_file.html#afe6aeaf0ca7573ceb8bb335c802dab16">seekSet()</a>. </p>
  1939. <dl class="params"><dt>Parameters</dt><dd>
  1940. <table class="params">
  1941. <tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>The new position in bytes from end-of-file. </td></tr>
  1942. </table>
  1943. </dd>
  1944. </dl>
  1945. <dl class="section return"><dt>Returns</dt><dd>true for success or false for failure. </dd></dl>
  1946. </div>
  1947. </div>
  1948. <a class="anchor" id="afe6aeaf0ca7573ceb8bb335c802dab16"></a>
  1949. <div class="memitem">
  1950. <div class="memproto">
  1951. <table class="memname">
  1952. <tr>
  1953. <td class="memname">bool SdBaseFile::seekSet </td>
  1954. <td>(</td>
  1955. <td class="paramtype">uint32_t&#160;</td>
  1956. <td class="paramname"><em>pos</em></td><td>)</td>
  1957. <td></td>
  1958. </tr>
  1959. </table>
  1960. </div><div class="memdoc">
  1961. <p>Sets a file's position.</p>
  1962. <dl class="params"><dt>Parameters</dt><dd>
  1963. <table class="params">
  1964. <tr><td class="paramdir">[in]</td><td class="paramname">pos</td><td>The new position in bytes from the beginning of the file.</td></tr>
  1965. </table>
  1966. </dd>
  1967. </dl>
  1968. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  1969. </div>
  1970. </div>
  1971. <a class="anchor" id="a71170390855df02c88cbda6e727e9609"></a>
  1972. <div class="memitem">
  1973. <div class="memproto">
  1974. <table class="memname">
  1975. <tr>
  1976. <td class="memname">void SdBaseFile::setpos </td>
  1977. <td>(</td>
  1978. <td class="paramtype"><a class="el" href="struct_fat_pos__t.html">FatPos_t</a> *&#160;</td>
  1979. <td class="paramname"><em>pos</em></td><td>)</td>
  1980. <td></td>
  1981. </tr>
  1982. </table>
  1983. </div><div class="memdoc">
  1984. <p>set position for streams </p>
  1985. <dl class="params"><dt>Parameters</dt><dd>
  1986. <table class="params">
  1987. <tr><td class="paramdir">[out]</td><td class="paramname">pos</td><td>struct with value for new position </td></tr>
  1988. </table>
  1989. </dd>
  1990. </dl>
  1991. </div>
  1992. </div>
  1993. <a class="anchor" id="a292247972772be832f2c6ea166f4049a"></a>
  1994. <div class="memitem">
  1995. <div class="memproto">
  1996. <table class="memname">
  1997. <tr>
  1998. <td class="memname">bool SdBaseFile::sync </td>
  1999. <td>(</td>
  2000. <td class="paramname"></td><td>)</td>
  2001. <td></td>
  2002. </tr>
  2003. </table>
  2004. </div><div class="memdoc">
  2005. <p>The <a class="el" href="class_sd_base_file.html#a292247972772be832f2c6ea166f4049a">sync()</a> call causes all modified data and directory fields to be written to the storage device.</p>
  2006. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. Reasons for failure include a call to <a class="el" href="class_sd_base_file.html#a292247972772be832f2c6ea166f4049a">sync()</a> before a file has been opened or an I/O error. </dd></dl>
  2007. </div>
  2008. </div>
  2009. <a class="anchor" id="adf84a0487f3b45fc183756b9d17141cd"></a>
  2010. <div class="memitem">
  2011. <div class="memproto">
  2012. <table class="memname">
  2013. <tr>
  2014. <td class="memname">bool SdBaseFile::timestamp </td>
  2015. <td>(</td>
  2016. <td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> *&#160;</td>
  2017. <td class="paramname"><em>file</em></td><td>)</td>
  2018. <td></td>
  2019. </tr>
  2020. </table>
  2021. </div><div class="memdoc">
  2022. <p>Copy a file's timestamps</p>
  2023. <dl class="params"><dt>Parameters</dt><dd>
  2024. <table class="params">
  2025. <tr><td class="paramdir">[in]</td><td class="paramname">file</td><td>File to copy timestamps from.</td></tr>
  2026. </table>
  2027. </dd>
  2028. </dl>
  2029. <dl class="section note"><dt>Note</dt><dd>Modify and access timestamps may be overwritten if a date time callback function has been set by <a class="el" href="class_sd_base_file.html#a1664a62726dcd7ff82c12d724b3b34df">dateTimeCallback()</a>.</dd></dl>
  2030. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  2031. </div>
  2032. </div>
  2033. <a class="anchor" id="ae55ad6000c44fc73e15934381b305dc4"></a>
  2034. <div class="memitem">
  2035. <div class="memproto">
  2036. <table class="memname">
  2037. <tr>
  2038. <td class="memname">bool SdBaseFile::timestamp </td>
  2039. <td>(</td>
  2040. <td class="paramtype">uint8_t&#160;</td>
  2041. <td class="paramname"><em>flags</em>, </td>
  2042. </tr>
  2043. <tr>
  2044. <td class="paramkey"></td>
  2045. <td></td>
  2046. <td class="paramtype">uint16_t&#160;</td>
  2047. <td class="paramname"><em>year</em>, </td>
  2048. </tr>
  2049. <tr>
  2050. <td class="paramkey"></td>
  2051. <td></td>
  2052. <td class="paramtype">uint8_t&#160;</td>
  2053. <td class="paramname"><em>month</em>, </td>
  2054. </tr>
  2055. <tr>
  2056. <td class="paramkey"></td>
  2057. <td></td>
  2058. <td class="paramtype">uint8_t&#160;</td>
  2059. <td class="paramname"><em>day</em>, </td>
  2060. </tr>
  2061. <tr>
  2062. <td class="paramkey"></td>
  2063. <td></td>
  2064. <td class="paramtype">uint8_t&#160;</td>
  2065. <td class="paramname"><em>hour</em>, </td>
  2066. </tr>
  2067. <tr>
  2068. <td class="paramkey"></td>
  2069. <td></td>
  2070. <td class="paramtype">uint8_t&#160;</td>
  2071. <td class="paramname"><em>minute</em>, </td>
  2072. </tr>
  2073. <tr>
  2074. <td class="paramkey"></td>
  2075. <td></td>
  2076. <td class="paramtype">uint8_t&#160;</td>
  2077. <td class="paramname"><em>second</em>&#160;</td>
  2078. </tr>
  2079. <tr>
  2080. <td></td>
  2081. <td>)</td>
  2082. <td></td><td></td>
  2083. </tr>
  2084. </table>
  2085. </div><div class="memdoc">
  2086. <p>Set a file's timestamps in its directory entry.</p>
  2087. <dl class="params"><dt>Parameters</dt><dd>
  2088. <table class="params">
  2089. <tr><td class="paramdir">[in]</td><td class="paramname">flags</td><td>Values for <em>flags</em> are constructed by a bitwise-inclusive OR of flags from the following list</td></tr>
  2090. </table>
  2091. </dd>
  2092. </dl>
  2093. <p>T_ACCESS - Set the file's last access date.</p>
  2094. <p>T_CREATE - Set the file's creation date and time.</p>
  2095. <p>T_WRITE - Set the file's last write/modification date and time.</p>
  2096. <dl class="params"><dt>Parameters</dt><dd>
  2097. <table class="params">
  2098. <tr><td class="paramdir">[in]</td><td class="paramname">year</td><td>Valid range 1980 - 2107 inclusive.</td></tr>
  2099. <tr><td class="paramdir">[in]</td><td class="paramname">month</td><td>Valid range 1 - 12 inclusive.</td></tr>
  2100. <tr><td class="paramdir">[in]</td><td class="paramname">day</td><td>Valid range 1 - 31 inclusive.</td></tr>
  2101. <tr><td class="paramdir">[in]</td><td class="paramname">hour</td><td>Valid range 0 - 23 inclusive.</td></tr>
  2102. <tr><td class="paramdir">[in]</td><td class="paramname">minute</td><td>Valid range 0 - 59 inclusive.</td></tr>
  2103. <tr><td class="paramdir">[in]</td><td class="paramname">second</td><td>Valid range 0 - 59 inclusive</td></tr>
  2104. </table>
  2105. </dd>
  2106. </dl>
  2107. <dl class="section note"><dt>Note</dt><dd>It is possible to set an invalid date since there is no check for the number of days in a month.</dd>
  2108. <dd>
  2109. Modify and access timestamps may be overwritten if a date time callback function has been set by <a class="el" href="class_sd_base_file.html#a1664a62726dcd7ff82c12d724b3b34df">dateTimeCallback()</a>.</dd></dl>
  2110. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
  2111. </div>
  2112. </div>
  2113. <a class="anchor" id="a9d1ad1abbd90089f731de81de1708c19"></a>
  2114. <div class="memitem">
  2115. <div class="memproto">
  2116. <table class="memname">
  2117. <tr>
  2118. <td class="memname">bool SdBaseFile::truncate </td>
  2119. <td>(</td>
  2120. <td class="paramtype">uint32_t&#160;</td>
  2121. <td class="paramname"><em>length</em></td><td>)</td>
  2122. <td></td>
  2123. </tr>
  2124. </table>
  2125. </div><div class="memdoc">
  2126. <p>Truncate a file to a specified length. The current file position will be maintained if it is less than or equal to <em>length</em> otherwise it will be set to end of file.</p>
  2127. <dl class="params"><dt>Parameters</dt><dd>
  2128. <table class="params">
  2129. <tr><td class="paramdir">[in]</td><td class="paramname">length</td><td>The desired length for the file.</td></tr>
  2130. </table>
  2131. </dd>
  2132. </dl>
  2133. <dl class="section return"><dt>Returns</dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. Reasons for failure include file is read only, file is a directory, <em>length</em> is greater than the current file size or an I/O error occurs. </dd></dl>
  2134. </div>
  2135. </div>
  2136. <a class="anchor" id="a1555e6866abc9c867c5fff189a3a4317"></a>
  2137. <div class="memitem">
  2138. <div class="memproto">
  2139. <table class="mlabels">
  2140. <tr>
  2141. <td class="mlabels-left">
  2142. <table class="memname">
  2143. <tr>
  2144. <td class="memname">uint8_t SdBaseFile::type </td>
  2145. <td>(</td>
  2146. <td class="paramname"></td><td>)</td>
  2147. <td> const</td>
  2148. </tr>
  2149. </table>
  2150. </td>
  2151. <td class="mlabels-right">
  2152. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  2153. </tr>
  2154. </table>
  2155. </div><div class="memdoc">
  2156. <p>Type of file. You should use <a class="el" href="class_sd_base_file.html#ab57b9744531ee0fcfa18bebde9fc50db">isFile()</a> or <a class="el" href="class_sd_base_file.html#ad43ed061a1f77578d3c30a0f9b198497">isDir()</a> instead of <a class="el" href="class_sd_base_file.html#a1555e6866abc9c867c5fff189a3a4317">type()</a> if possible.</p>
  2157. <dl class="section return"><dt>Returns</dt><dd>The file or directory type. </dd></dl>
  2158. </div>
  2159. </div>
  2160. <a class="anchor" id="acb021c2b7f68778d683d093775532a06"></a>
  2161. <div class="memitem">
  2162. <div class="memproto">
  2163. <table class="mlabels">
  2164. <tr>
  2165. <td class="mlabels-left">
  2166. <table class="memname">
  2167. <tr>
  2168. <td class="memname"><a class="el" href="class_sd_volume.html">SdVolume</a>* SdBaseFile::volume </td>
  2169. <td>(</td>
  2170. <td class="paramname"></td><td>)</td>
  2171. <td> const</td>
  2172. </tr>
  2173. </table>
  2174. </td>
  2175. <td class="mlabels-right">
  2176. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  2177. </tr>
  2178. </table>
  2179. </div><div class="memdoc">
  2180. <dl class="section return"><dt>Returns</dt><dd><a class="el" href="class_sd_volume.html" title="Access FAT16 and FAT32 volumes on SD and SDHC cards. ">SdVolume</a> that contains this file. </dd></dl>
  2181. </div>
  2182. </div>
  2183. <a class="anchor" id="a874e3bae567f96bed5ad442beb846a61"></a>
  2184. <div class="memitem">
  2185. <div class="memproto">
  2186. <table class="memname">
  2187. <tr>
  2188. <td class="memname">int SdBaseFile::write </td>
  2189. <td>(</td>
  2190. <td class="paramtype">const void *&#160;</td>
  2191. <td class="paramname"><em>buf</em>, </td>
  2192. </tr>
  2193. <tr>
  2194. <td class="paramkey"></td>
  2195. <td></td>
  2196. <td class="paramtype">size_t&#160;</td>
  2197. <td class="paramname"><em>nbyte</em>&#160;</td>
  2198. </tr>
  2199. <tr>
  2200. <td></td>
  2201. <td>)</td>
  2202. <td></td><td></td>
  2203. </tr>
  2204. </table>
  2205. </div><div class="memdoc">
  2206. <p>Write data to an open file.</p>
  2207. <dl class="section note"><dt>Note</dt><dd>Data is moved to the cache but may not be written to the storage device until <a class="el" href="class_sd_base_file.html#a292247972772be832f2c6ea166f4049a">sync()</a> is called.</dd></dl>
  2208. <dl class="params"><dt>Parameters</dt><dd>
  2209. <table class="params">
  2210. <tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>Pointer to the location of the data to be written.</td></tr>
  2211. <tr><td class="paramdir">[in]</td><td class="paramname">nbyte</td><td>Number of bytes to write.</td></tr>
  2212. </table>
  2213. </dd>
  2214. </dl>
  2215. <dl class="section return"><dt>Returns</dt><dd>For success <a class="el" href="class_sd_base_file.html#a874e3bae567f96bed5ad442beb846a61">write()</a> returns the number of bytes written, always <em>nbyte</em>. If an error occurs, <a class="el" href="class_sd_base_file.html#a874e3bae567f96bed5ad442beb846a61">write()</a> returns -1. Possible errors include <a class="el" href="class_sd_base_file.html#a874e3bae567f96bed5ad442beb846a61">write()</a> is called before a file has been opened, write is called for a read-only file, device is full, a corrupt file system or an I/O error. </dd></dl>
  2216. </div>
  2217. </div>
  2218. <h2 class="groupheader">Friends And Related Function Documentation</h2>
  2219. <a class="anchor" id="ac838f1e6beb01ec57bd4b52e57df85e7"></a>
  2220. <div class="memitem">
  2221. <div class="memproto">
  2222. <table class="mlabels">
  2223. <tr>
  2224. <td class="mlabels-left">
  2225. <table class="memname">
  2226. <tr>
  2227. <td class="memname">friend class <a class="el" href="class_sd_fat.html">SdFat</a></td>
  2228. </tr>
  2229. </table>
  2230. </td>
  2231. <td class="mlabels-right">
  2232. <span class="mlabels"><span class="mlabel">friend</span></span> </td>
  2233. </tr>
  2234. </table>
  2235. </div><div class="memdoc">
  2236. </div>
  2237. </div>
  2238. <h2 class="groupheader">Member Data Documentation</h2>
  2239. <a class="anchor" id="a47d4ba2177ffcd99c2387f9fac182d5b"></a>
  2240. <div class="memitem">
  2241. <div class="memproto">
  2242. <table class="memname">
  2243. <tr>
  2244. <td class="memname">bool SdBaseFile::writeError</td>
  2245. </tr>
  2246. </table>
  2247. </div><div class="memdoc">
  2248. <p>writeError is set to true if an error occurs during a <a class="el" href="class_sd_base_file.html#a874e3bae567f96bed5ad442beb846a61">write()</a>. Set writeError to false before calling print() and/or <a class="el" href="class_sd_base_file.html#a874e3bae567f96bed5ad442beb846a61">write()</a> and check for true after calls to print() and/or <a class="el" href="class_sd_base_file.html#a874e3bae567f96bed5ad442beb846a61">write()</a>. </p>
  2249. </div>
  2250. </div>
  2251. <hr/>The documentation for this class was generated from the following files:<ul>
  2252. <li>Arduino/libraries/SdFat/<a class="el" href="_sd_base_file_8h.html">SdBaseFile.h</a></li>
  2253. <li>Arduino/libraries/SdFat/<a class="el" href="_sd_base_file_8cpp.html">SdBaseFile.cpp</a></li>
  2254. <li>Arduino/libraries/SdFat/<a class="el" href="_sd_base_file_print_8cpp.html">SdBaseFilePrint.cpp</a></li>
  2255. </ul>
  2256. </div><!-- contents -->
  2257. <!-- start footer part -->
  2258. <hr class="footer"/><address class="footer"><small>
  2259. Generated on Fri Oct 24 2014 05:45:13 for SdFat by &#160;<a href="http://www.doxygen.org/index.html">
  2260. <img class="footer" src="doxygen.png" alt="doxygen"/>
  2261. </a> 1.8.6
  2262. </small></address>
  2263. </body>
  2264. </html>