2122 lines
106 KiB
HTML
2122 lines
106 KiB
HTML
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||
|
<title>SdFat: SdFile Class Reference</title>
|
||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||
|
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
||
|
</head>
|
||
|
<body>
|
||
|
<!-- Generated by Doxygen 1.7.4 -->
|
||
|
<div id="top">
|
||
|
<div id="titlearea">
|
||
|
<table cellspacing="0" cellpadding="0">
|
||
|
<tbody>
|
||
|
<tr style="height: 56px;">
|
||
|
<td style="padding-left: 0.5em;">
|
||
|
<div id="projectname">SdFat</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div id="navrow1" class="tabs">
|
||
|
<ul class="tablist">
|
||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div id="navrow2" class="tabs2">
|
||
|
<ul class="tablist">
|
||
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
||
|
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
|
||
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="header">
|
||
|
<div class="summary">
|
||
|
<a href="#pub-methods">Public Member Functions</a> |
|
||
|
<a href="#pub-static-methods">Static Public Member Functions</a> |
|
||
|
<a href="#pub-attribs">Public Attributes</a> </div>
|
||
|
<div class="headertitle">
|
||
|
<div class="title">SdFile Class Reference</div> </div>
|
||
|
</div>
|
||
|
<div class="contents">
|
||
|
<!-- doxytag: class="SdFile" --><!-- doxytag: inherits="SdBaseFile" -->
|
||
|
<p><a class="el" href="class_sd_base_file.html" title="Base class for SdFile with Print and C++ streams.">SdBaseFile</a> with Print.
|
||
|
<a href="class_sd_file.html#details">More...</a></p>
|
||
|
|
||
|
<p><code>#include <SdFile.h></code></p>
|
||
|
<div class="dynheader">
|
||
|
Inheritance diagram for SdFile:</div>
|
||
|
<div class="dyncontent">
|
||
|
<div class="center"><img src="class_sd_file__inherit__graph.png" border="0" usemap="#_sd_file_inherit__map" alt="Inheritance graph"/></div>
|
||
|
<map name="_sd_file_inherit__map" id="_sd_file_inherit__map">
|
||
|
<area shape="rect" id="node2" href="class_sd_base_file.html" title="Base class for SdFile with Print and C++ streams." alt="" coords="5,5,88,32"/>
</map>
|
||
|
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
|
||
|
<div class="dynheader">
|
||
|
Collaboration diagram for SdFile:</div>
|
||
|
<div class="dyncontent">
|
||
|
<div class="center"><img src="class_sd_file__coll__graph.png" border="0" usemap="#_sd_file_coll__map" alt="Collaboration graph"/></div>
|
||
|
<map name="_sd_file_coll__map" id="_sd_file_coll__map">
|
||
|
<area shape="rect" id="node2" href="class_sd_base_file.html" title="Base class for SdFile with Print and C++ streams." alt="" coords="290,368,373,395"/>
<area shape="rect" id="node4" href="class_sd_volume.html" title="Access FAT16 and FAT32 volumes on SD and SDHC cards." alt="" coords="292,277,372,304"/>
<area shape="rect" id="node6" href="unioncache__t.html" title="Cache for an SD data block." alt="" coords="247,187,313,213"/>
<area shape="rect" id="node8" href="structdirectory_entry.html" title="FAT short directory entry." alt="" coords="5,96,107,123"/>
<area shape="rect" id="node10" href="structfat32__fsinfo.html" title="FSINFO sector for a FAT32 volume." alt="" coords="131,96,220,123"/>
<area shape="rect" id="node12" href="structfat__boot.html" title="Boot sector for a FAT12/FAT16 volume." alt="" coords="245,96,315,123"/>
<area shape="rect" id="node14" href="structmaster_boot_record.html" title="Master Boot Record." alt="" coords="339,96,465,123"/>
<area shape="rect" id="node16" href="structpartition_table.html" title="MBR partition table entry." alt="" coords="352,5,453,32"/>
<area shape="rect" id="node18" href="structfat32__boot.html" title="Boot sector for a FAT32 volume." alt="" coords="491,96,573,123"/>
<area shape="rect" id="node20" href="class_sd2_card.html" title="Raw access to SD and SDHC flash memory cards." alt="" coords="350,187,420,213"/>
</map>
|
||
|
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
|
||
|
|
||
|
<p><a href="class_sd_file-members.html">List of all members.</a></p>
|
||
|
<table class="memberdecls">
|
||
|
<tr><td colspan="2"><h2><a name="pub-methods"></a>
|
||
|
Public Member Functions</h2></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ac4381fe633716069f2161d9e9fef5d16">available</a> ()</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_file.html#ac9898f5e004588267d8a31762ac47e60">clearWriteError</a> ()</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a17f7e949aa0f80d89782d8e31f5edc15">close</a> ()</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#afd2ed78a03600924ef6502a86d7c6291">curCluster</a> () const </td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a9739ca25a7c804cace68f95c14658c44">curPosition</a> () const </td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a0977fc620f90e21897eca1fb1c25fdce">dirEntry</a> (<a class="el" href="structdirectory_entry.html">dir_t</a> *dir)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#aa0b95ccc568d483f1416d2eacd1ff3f7">exists</a> (const char *name)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int16_t </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a32ac452756fdf80aae75fb1ab093a421">fileSize</a> () const </td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#adca5f8fce7851f9b7abc92cb73e49e35">firstCluster</a> () const </td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a2e84ccce858fd7e4d88e26b23d19a822">getFilename</a> (char *name)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_file.html#adfb128479bcdc998b09151b2c47e828f">getWriteError</a> ()</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ad43ed061a1f77578d3c30a0f9b198497">isDir</a> () const </td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ab57b9744531ee0fcfa18bebde9fc50db">isFile</a> () const </td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a0fb6e697de39cdb777744981f58eaaa8">isOpen</a> () const </td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ad1fcdcb6c1cb66207d243584e6049095">isRoot</a> () const </td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a50023837ddbc57b10098d3a7cd5856f7">isSubDir</a> () const </td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a925b3badddc0f9472730a4ccd4ff7b67">ls</a> (uint8_t flags=0)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a63854cd9c57a9910779ca22112b436e0">open</a> (const char *path, uint8_t oflag=<a class="el" href="_sd_base_file_8h.html#ac5a1c3e543273b0374ba114c496e662e">O_READ</a>)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a996abee868ce928d04d9d0ad9305c915">peek</a> ()</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#afe2fd8314f3a6c0e06ff178f730efe07">printCreateDateTime</a> (Print *pr)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a65604a3450e69799f2969b6a145647dc">printModifyDateTime</a> (Print *pr)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a239cacb867f6c4f93eb52c38c60684d7">printName</a> ()</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#acb64cd7f69705eb269bfab8e6372e86b">printName</a> (Print *pr)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a145595e55db1629fa126ffa2628fe9eb">read</a> ()</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ae5dd9c5f9764db71c90c5fcfb02b2c97">readDir</a> (<a class="el" href="structdirectory_entry.html">dir_t</a> *dir)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a6e88ee210c9bd7556477c0e7ba4de1bb">remove</a> ()</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a7a5369b40eb15ad26c2e4af5d069c52c">rewind</a> ()</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a7268834187e8216605963f8ae3cf1e6e">rmdir</a> ()</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a4186ba79c83005971096966c0fd02d46">rmRfStar</a> ()</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_file.html#acacaaf3201d9eb149183cf52f1f139a5">SdFile</a> (const char *name, uint8_t oflag)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#ab04ec7e129607973f6e3436f779b6501">seekCur</a> (int32_t offset)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a6f42e496b179dbdd2c09083cfad28613">seekEnd</a> (int32_t offset=0)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#afe6aeaf0ca7573ceb8bb335c802dab16">seekSet</a> (uint32_t pos)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a292247972772be832f2c6ea166f4049a">sync</a> ()</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a9d1ad1abbd90089f731de81de1708c19">truncate</a> (uint32_t size)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a1555e6866abc9c867c5fff189a3a4317">type</a> () const </td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_sd_volume.html">SdVolume</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#acb021c2b7f68778d683d093775532a06">volume</a> () const </td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_file.html#a7329a9bde292b3baad6d6dfbd72afe90">write</a> (const void *buf, size_t nbyte)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_file.html#a489af4bffef36ee4c22d422ba68b1b00">write</a> (const char *str)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_file.html#a67267a4b63d03a16e099195935613006">write</a> (uint8_t b)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_file.html#adaa153fed109a0a03cfd545a259de4fe">write_P</a> (PGM_P str)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_file.html#ad760d51410f36fd1e1b005a754624954">writeln_P</a> (PGM_P str)</td></tr>
|
||
|
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
|
||
|
Static Public Member Functions</h2></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_sd_base_file.html">SdBaseFile</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a56b9402969b3348c97b413750226f955">cwd</a> ()</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">static void </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a04e3e7829c56a6b11df8df0051a49ef9">dateTimeCallbackCancel</a> ()</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a8fdbf7893bf19793e772b340e4c08fed">dirName</a> (const <a class="el" href="structdirectory_entry.html">dir_t</a> &dir, char *name)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a1f8b53aea38427dd483dfff4e9437d0c">printFatDate</a> (uint16_t fatDate)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">static void </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">static void </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>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a9d7dcf89a8d3144731e59ea74a640d68">printFatTime</a> (uint16_t fatTime)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">static bool </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>
|
||
|
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
|
||
|
Public Attributes</h2></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sd_base_file.html#a47d4ba2177ffcd99c2387f9fac182d5b">writeError</a></td></tr>
|
||
|
</table>
|
||
|
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
|
||
|
<div class="textblock"><p><a class="el" href="class_sd_base_file.html" title="Base class for SdFile with Print and C++ streams.">SdBaseFile</a> with Print. </p>
|
||
|
</div><hr/><h2>Constructor & Destructor Documentation</h2>
|
||
|
<a class="anchor" id="acacaaf3201d9eb149183cf52f1f139a5"></a><!-- doxytag: member="SdFile::SdFile" ref="acacaaf3201d9eb149183cf52f1f139a5" args="(const char *name, uint8_t oflag)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">SdFile::SdFile </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"><em>path</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>oflag</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Create a file object and open it in the current working directory.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<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>
|
||
|
<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>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr/><h2>Member Function Documentation</h2>
|
||
|
<a class="anchor" id="ac4381fe633716069f2161d9e9fef5d16"></a><!-- doxytag: member="SdFile::available" ref="ac4381fe633716069f2161d9e9fef5d16" args="()" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">uint32_t SdBaseFile::available </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td><code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>number of bytes available from yhe current position to EOF </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ac9898f5e004588267d8a31762ac47e60"></a><!-- doxytag: member="SdFile::clearWriteError" ref="ac9898f5e004588267d8a31762ac47e60" args="()" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void SdFile::clearWriteError </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td><code> [inline]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Set writeError to zero </p>
|
||
|
|
||
|
<p>Reimplemented from <a class="el" href="class_sd_base_file.html#a6b4e639ae03ec48c9becd8b472aa1b50">SdBaseFile</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a17f7e949aa0f80d89782d8e31f5edc15"></a><!-- doxytag: member="SdFile::close" ref="a17f7e949aa0f80d89782d8e31f5edc15" args="()" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::close </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Close a file and force cached data and directory information to be written to the storage device.</p>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
<p>Reimplemented in <a class="el" href="classfstream.html#ac5720ee620c09d63dd186823e688ea9a">fstream</a>, <a class="el" href="classifstream.html#ac5892f472afdef6160f5fe2401b16dce">ifstream</a>, and <a class="el" href="classofstream.html#a240f3752c7ff7a78d10c143d2083715f">ofstream</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a272c68ba97eb5452ce903e6f8d2895a6"></a><!-- doxytag: member="SdFile::contiguousRange" ref="a272c68ba97eb5452ce903e6f8d2895a6" args="(uint32_t *bgnBlock, uint32_t *endBlock)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::contiguousRange </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">uint32_t * </td>
|
||
|
<td class="paramname"><em>bgnBlock</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint32_t * </td>
|
||
|
<td class="paramname"><em>endBlock</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Check for contiguous file and return its raw block range.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[out]</td><td class="paramname">bgnBlock</td><td>the first block address for the file. </td></tr>
|
||
|
<tr><td class="paramdir">[out]</td><td class="paramname">endBlock</td><td>the last block address for the file.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ad14a78d348219d6ce096582b6ed74526"></a><!-- doxytag: member="SdFile::createContiguous" ref="ad14a78d348219d6ce096582b6ed74526" args="(SdBaseFile *dirFile, const char *path, uint32_t size)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::createContiguous </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> * </td>
|
||
|
<td class="paramname"><em>dirFile</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"><em>path</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint32_t </td>
|
||
|
<td class="paramname"><em>size</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Create and open a new contiguous file of a specified size.</p>
|
||
|
<dl class="note"><dt><b>Note:</b></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>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">dirFile</td><td>The directory where the file will be created. </td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">path</td><td>A path with a valid DOS 8.3 file name. </td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>The desired file size.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="afd2ed78a03600924ef6502a86d7c6291"></a><!-- doxytag: member="SdFile::curCluster" ref="afd2ed78a03600924ef6502a86d7c6291" args="() const " -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">uint32_t SdBaseFile::curCluster </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const<code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The current cluster number for a file or directory. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a9739ca25a7c804cace68f95c14658c44"></a><!-- doxytag: member="SdFile::curPosition" ref="a9739ca25a7c804cace68f95c14658c44" args="() const " -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">uint32_t SdBaseFile::curPosition </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const<code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The current position for a file or directory. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a56b9402969b3348c97b413750226f955"></a><!-- doxytag: member="SdFile::cwd" ref="a56b9402969b3348c97b413750226f955" args="()" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">static <a class="el" href="class_sd_base_file.html">SdBaseFile</a>* SdBaseFile::cwd </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td><code> [inline, static, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>Current working directory </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a1664a62726dcd7ff82c12d724b3b34df"></a><!-- doxytag: member="SdFile::dateTimeCallback" ref="a1664a62726dcd7ff82c12d724b3b34df" args="(void(*dateTime)(uint16_t *date, uint16_t *time))" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">static void SdBaseFile::dateTimeCallback </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">void(*)(uint16_t *date, uint16_t *time) </td>
|
||
|
<td class="paramname"><em>dateTime</em></td><td>)</td>
|
||
|
<td><code> [inline, static, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Set the date/time callback function</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<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>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> dateTime(uint16_t* date, uint16_t* time) {
|
||
|
uint16_t year;
|
||
|
uint8_t month, day, hour, minute, second;
|
||
|
|
||
|
<span class="comment">// User gets date and time from GPS or real-time clock here</span>
|
||
|
|
||
|
<span class="comment">// return date using FAT_DATE macro to format fields</span>
|
||
|
*date = <a class="code" href="_sd_base_file_8h.html#a44899ad42ddf32ff1c1a73b5251b304a">FAT_DATE</a>(year, month, day);
|
||
|
|
||
|
<span class="comment">// return time using FAT_TIME macro to format fields</span>
|
||
|
*time = <a class="code" href="_sd_base_file_8h.html#a375720927be5a39475d48b2d75dae29a">FAT_TIME</a>(hour, minute, second);
|
||
|
}
|
||
|
</pre></div><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>
|
||
|
<p>See the <a class="el" href="class_sd_base_file.html#adf84a0487f3b45fc183756b9d17141cd">timestamp()</a> function. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a04e3e7829c56a6b11df8df0051a49ef9"></a><!-- doxytag: member="SdFile::dateTimeCallbackCancel" ref="a04e3e7829c56a6b11df8df0051a49ef9" args="()" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">static void SdBaseFile::dateTimeCallbackCancel </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td><code> [inline, static, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Cancel the date/time callback function. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a0977fc620f90e21897eca1fb1c25fdce"></a><!-- doxytag: member="SdFile::dirEntry" ref="a0977fc620f90e21897eca1fb1c25fdce" args="(dir_t *dir)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::dirEntry </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="structdirectory_entry.html">dir_t</a> * </td>
|
||
|
<td class="paramname"><em>dir</em></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Return a file's directory entry.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[out]</td><td class="paramname">dir</td><td>Location for return of the file's directory entry.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a8fdbf7893bf19793e772b340e4c08fed"></a><!-- doxytag: member="SdFile::dirName" ref="a8fdbf7893bf19793e772b340e4c08fed" args="(const dir_t &dir, char *name)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void SdBaseFile::dirName </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const <a class="el" href="structdirectory_entry.html">dir_t</a> & </td>
|
||
|
<td class="paramname"><em>dir</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char * </td>
|
||
|
<td class="paramname"><em>name</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [static, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<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>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">dir</td><td>The directory structure containing the name. </td></tr>
|
||
|
<tr><td class="paramdir">[out]</td><td class="paramname">name</td><td>A 13 byte char array for the formatted name. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="aa0b95ccc568d483f1416d2eacd1ff3f7"></a><!-- doxytag: member="SdFile::exists" ref="aa0b95ccc568d483f1416d2eacd1ff3f7" args="(const char *name)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::exists </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"><em>name</em></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Test for the existence of a file in a directory</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">name</td><td>Name of the file to be tested for.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<p>The calling instance must be an open directory file.</p>
|
||
|
<p>dirFile.exists("TOFIND.TXT") searches for "TOFIND.TXT" in the directory dirFile.</p>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the file exists else false. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a41de4f35c622c1a5f5699400e8d05a87"></a><!-- doxytag: member="SdFile::fgets" ref="a41de4f35c622c1a5f5699400e8d05a87" args="(char *str, int16_t num, char *delim=0)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int16_t SdBaseFile::fgets </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">char * </td>
|
||
|
<td class="paramname"><em>str</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">int16_t </td>
|
||
|
<td class="paramname"><em>num</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char * </td>
|
||
|
<td class="paramname"><em>delim</em> = <code>0</code> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Get a string from a file.</p>
|
||
|
<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>
|
||
|
<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>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[out]</td><td class="paramname">str</td><td>Pointer to the array where the string is stored. </td></tr>
|
||
|
<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>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">delim</td><td>Optional set of delimiters. The default is "\n".</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a32ac452756fdf80aae75fb1ab093a421"></a><!-- doxytag: member="SdFile::fileSize" ref="a32ac452756fdf80aae75fb1ab093a421" args="() const " -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">uint32_t SdBaseFile::fileSize </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const<code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The total number of bytes in a file or directory. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="adca5f8fce7851f9b7abc92cb73e49e35"></a><!-- doxytag: member="SdFile::firstCluster" ref="adca5f8fce7851f9b7abc92cb73e49e35" args="() const " -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">uint32_t SdBaseFile::firstCluster </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const<code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The first cluster number for a file or directory. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a2e84ccce858fd7e4d88e26b23d19a822"></a><!-- doxytag: member="SdFile::getFilename" ref="a2e84ccce858fd7e4d88e26b23d19a822" args="(char *name)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::getFilename </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">char * </td>
|
||
|
<td class="paramname"><em>name</em></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Get a file's name</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[out]</td><td class="paramname">name</td><td>An array of 13 characters for the file's name.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ad1af089e5cf0a4c86e9b6bae1595f59b"></a><!-- doxytag: member="SdFile::getpos" ref="ad1af089e5cf0a4c86e9b6bae1595f59b" args="(FatPos_t *pos)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void SdBaseFile::getpos </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="struct_fat_pos__t.html">FatPos_t</a> * </td>
|
||
|
<td class="paramname"><em>pos</em></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>get position for streams </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[out]</td><td class="paramname">pos</td><td>struct to receive position </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="adfb128479bcdc998b09151b2c47e828f"></a><!-- doxytag: member="SdFile::getWriteError" ref="adfb128479bcdc998b09151b2c47e828f" args="()" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdFile::getWriteError </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td><code> [inline]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>value of writeError </dd></dl>
|
||
|
|
||
|
<p>Reimplemented from <a class="el" href="class_sd_base_file.html#aa8ebd3ec28126c3171059d3e7dd355b9">SdBaseFile</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ad43ed061a1f77578d3c30a0f9b198497"></a><!-- doxytag: member="SdFile::isDir" ref="ad43ed061a1f77578d3c30a0f9b198497" args="() const " -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::isDir </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const<code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>True if this is a directory else false. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ab57b9744531ee0fcfa18bebde9fc50db"></a><!-- doxytag: member="SdFile::isFile" ref="ab57b9744531ee0fcfa18bebde9fc50db" args="() const " -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::isFile </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const<code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>True if this is a normal file else false. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a0fb6e697de39cdb777744981f58eaaa8"></a><!-- doxytag: member="SdFile::isOpen" ref="a0fb6e697de39cdb777744981f58eaaa8" args="() const " -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::isOpen </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const<code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>True if this is an open file/directory else false. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ad1fcdcb6c1cb66207d243584e6049095"></a><!-- doxytag: member="SdFile::isRoot" ref="ad1fcdcb6c1cb66207d243584e6049095" args="() const " -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::isRoot </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const<code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>True if this is the root directory. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a50023837ddbc57b10098d3a7cd5856f7"></a><!-- doxytag: member="SdFile::isSubDir" ref="a50023837ddbc57b10098d3a7cd5856f7" args="() const " -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::isSubDir </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const<code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>True if this is a subdirectory else false. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a925b3badddc0f9472730a4ccd4ff7b67"></a><!-- doxytag: member="SdFile::ls" ref="a925b3badddc0f9472730a4ccd4ff7b67" args="(uint8_t flags=0)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void SdBaseFile::ls </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>flags</em> = <code>0</code></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>List directory contents to stdOut.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">flags</td><td>The inclusive OR of</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<p>LS_DATE - Print file modification date</p>
|
||
|
<p>LS_SIZE - Print file size.</p>
|
||
|
<p>LS_R - Recursive list of subdirectories. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ae94a6672e77325d91cf2ae7077f4c785"></a><!-- doxytag: member="SdFile::ls" ref="ae94a6672e77325d91cf2ae7077f4c785" args="(Print *pr, uint8_t flags=0, uint8_t indent=0)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void SdBaseFile::ls </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">Print * </td>
|
||
|
<td class="paramname"><em>pr</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>flags</em> = <code>0</code>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>indent</em> = <code>0</code> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>List directory contents.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">pr</td><td>Print stream for list.</td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">flags</td><td>The inclusive OR of</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<p>LS_DATE - Print file modification date</p>
|
||
|
<p>LS_SIZE - Print file size.</p>
|
||
|
<p>LS_R - Recursive list of subdirectories.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<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>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ad1de34e5dc5b3a1727208f949b5838e9"></a><!-- doxytag: member="SdFile::mkdir" ref="ad1de34e5dc5b3a1727208f949b5838e9" args="(SdBaseFile *dir, const char *path, bool pFlag=true)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::mkdir </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> * </td>
|
||
|
<td class="paramname"><em>parent</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"><em>path</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">bool </td>
|
||
|
<td class="paramname"><em>pFlag</em> = <code>true</code> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Make a new directory.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<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>
|
||
|
<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>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">pFlag</td><td>Create missing parent directories if true.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a6ff5b48f672515ec20831583de74407f"></a><!-- doxytag: member="SdFile::open" ref="a6ff5b48f672515ec20831583de74407f" args="(SdBaseFile *dirFile, uint16_t index, uint8_t oflag)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::open </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> * </td>
|
||
|
<td class="paramname"><em>dirFile</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint16_t </td>
|
||
|
<td class="paramname"><em>index</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>oflag</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Open a file by index.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<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>
|
||
|
<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>
|
||
|
<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>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<p>See <a class="el" href="class_sd_base_file.html#a6ff5b48f672515ec20831583de74407f">open()</a> by path for definition of flags. </p>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>true for success or false for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a4b88be0d893bcada9b203bdd33fff8e2"></a><!-- doxytag: member="SdFile::open" ref="a4b88be0d893bcada9b203bdd33fff8e2" args="(SdBaseFile *dirFile, const char *path, uint8_t oflag)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::open </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> * </td>
|
||
|
<td class="paramname"><em>dirFile</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"><em>path</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>oflag</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Open a file or directory by name.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<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>
|
||
|
<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>
|
||
|
<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>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<p>O_READ - Open for reading.</p>
|
||
|
<p>O_RDONLY - Same as O_READ.</p>
|
||
|
<p>O_WRITE - Open for writing.</p>
|
||
|
<p>O_WRONLY - Same as O_WRITE.</p>
|
||
|
<p>O_RDWR - Open for reading and writing.</p>
|
||
|
<p>O_APPEND - If set, the file offset shall be set to the end of the file prior to each write.</p>
|
||
|
<p>O_AT_END - Set the initial position at the end of the file.</p>
|
||
|
<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>
|
||
|
<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>
|
||
|
<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>
|
||
|
<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>
|
||
|
<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 of file corruption may occur.</p>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>Directory files must be opened read only. Write and truncation is not allowed for directory files.</dd></dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a63854cd9c57a9910779ca22112b436e0"></a><!-- doxytag: member="SdFile::open" ref="a63854cd9c57a9910779ca22112b436e0" args="(const char *path, uint8_t oflag=O_READ)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::open </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"><em>path</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>oflag</em> = <code><a class="el" href="_sd_base_file_8h.html#ac5a1c3e543273b0374ba114c496e662e">O_READ</a></code> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Open a file in the current working directory.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<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>
|
||
|
<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>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
|
||
|
|
||
|
<p>Reimplemented in <a class="el" href="classfstream.html#a85b24d94552991f33caf4c3a83420879">fstream</a>, <a class="el" href="classifstream.html#a169694d6535fd551fd6db48a2867590e">ifstream</a>, and <a class="el" href="classofstream.html#a4b9d30c742fbe01baa336406c7afdcb2">ofstream</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="aee4c736345e96aa5ddb7e5768ce88f51"></a><!-- doxytag: member="SdFile::openNext" ref="aee4c736345e96aa5ddb7e5768ce88f51" args="(SdBaseFile *dirFile, uint8_t oflag)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::openNext </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> * </td>
|
||
|
<td class="paramname"><em>dirFile</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>oflag</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Open the next file or subdirectory in a directory.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<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>
|
||
|
<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>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<p>See <a class="el" href="class_sd_base_file.html#a6ff5b48f672515ec20831583de74407f">open()</a> by path for definition of flags. </p>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>true for success or false for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ac67ffdfb84263bcd425886c09a15e287"></a><!-- doxytag: member="SdFile::openRoot" ref="ac67ffdfb84263bcd425886c09a15e287" args="(SdVolume *vol)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::openRoot </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="class_sd_volume.html">SdVolume</a> * </td>
|
||
|
<td class="paramname"><em>vol</em></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Open a volume's root directory.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">vol</td><td>The FAT volume containing the root directory to be opened.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a996abee868ce928d04d9d0ad9305c915"></a><!-- doxytag: member="SdFile::peek" ref="a996abee868ce928d04d9d0ad9305c915" args="()" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int SdBaseFile::peek </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Return the next available byte without consuming it.</p>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The byte if no error and not at eof else -1; </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="afe2fd8314f3a6c0e06ff178f730efe07"></a><!-- doxytag: member="SdFile::printCreateDateTime" ref="afe2fd8314f3a6c0e06ff178f730efe07" args="(Print *pr)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::printCreateDateTime </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">Print * </td>
|
||
|
<td class="paramname"><em>pr</em></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Print a file's creation date and time</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">pr</td><td>Print stream for output.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a1f8b53aea38427dd483dfff4e9437d0c"></a><!-- doxytag: member="SdFile::printFatDate" ref="a1f8b53aea38427dd483dfff4e9437d0c" args="(uint16_t fatDate)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void SdBaseFile::printFatDate </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">uint16_t </td>
|
||
|
<td class="paramname"><em>fatDate</em></td><td>)</td>
|
||
|
<td><code> [static, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Print a directory date field to stdOut.</p>
|
||
|
<p>Format is yyyy-mm-dd.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">fatDate</td><td>The date field from a directory entry. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a460b641eb358f2d6ac7a937944f9fba4"></a><!-- doxytag: member="SdFile::printFatDate" ref="a460b641eb358f2d6ac7a937944f9fba4" args="(Print *pr, uint16_t fatDate)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void SdBaseFile::printFatDate </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">Print * </td>
|
||
|
<td class="paramname"><em>pr</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint16_t </td>
|
||
|
<td class="paramname"><em>fatDate</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [static, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Print a directory date field.</p>
|
||
|
<p>Format is yyyy-mm-dd.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">pr</td><td>Print stream for output. </td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">fatDate</td><td>The date field from a directory entry. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a9d7dcf89a8d3144731e59ea74a640d68"></a><!-- doxytag: member="SdFile::printFatTime" ref="a9d7dcf89a8d3144731e59ea74a640d68" args="(uint16_t fatTime)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void SdBaseFile::printFatTime </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">uint16_t </td>
|
||
|
<td class="paramname"><em>fatTime</em></td><td>)</td>
|
||
|
<td><code> [static, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Print a directory time field to stdOut.</p>
|
||
|
<p>Format is hh:mm:ss.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">fatTime</td><td>The time field from a directory entry. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="af4d9cedda669bccdc8c8eeea73d04943"></a><!-- doxytag: member="SdFile::printFatTime" ref="af4d9cedda669bccdc8c8eeea73d04943" args="(Print *pr, uint16_t fatTime)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void SdBaseFile::printFatTime </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">Print * </td>
|
||
|
<td class="paramname"><em>pr</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint16_t </td>
|
||
|
<td class="paramname"><em>fatTime</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [static, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Print a directory time field.</p>
|
||
|
<p>Format is hh:mm:ss.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">pr</td><td>Print stream for output. </td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">fatTime</td><td>The time field from a directory entry. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a8fcc3db8e05121c739d8d43ee40fec72"></a><!-- doxytag: member="SdFile::printField" ref="a8fcc3db8e05121c739d8d43ee40fec72" args="(int16_t value, char term)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int SdBaseFile::printField </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">int16_t </td>
|
||
|
<td class="paramname"><em>value</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char </td>
|
||
|
<td class="paramname"><em>term</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Print a number followed by a field terminator. </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The number to be printed. </td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">term</td><td>The field terminator. Use '\n' for CR LF. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of bytes written or -1 if an error occurs. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a71050abe5bed8e44f48ae75627b54c63"></a><!-- doxytag: member="SdFile::printField" ref="a71050abe5bed8e44f48ae75627b54c63" args="(uint16_t value, char term)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int SdBaseFile::printField </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">uint16_t </td>
|
||
|
<td class="paramname"><em>value</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char </td>
|
||
|
<td class="paramname"><em>term</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Print a number followed by a field terminator. </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The number to be printed. </td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">term</td><td>The field terminator. Use '\n' for CR LF. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of bytes written or -1 if an error occurs. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a27146777c4d215cb5887edab4b4599b0"></a><!-- doxytag: member="SdFile::printField" ref="a27146777c4d215cb5887edab4b4599b0" args="(uint32_t value, char term)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int SdBaseFile::printField </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">uint32_t </td>
|
||
|
<td class="paramname"><em>value</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char </td>
|
||
|
<td class="paramname"><em>term</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Print a number followed by a field terminator. </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The number to be printed. </td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">term</td><td>The field terminator. Use '\n' for CR LF. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of bytes written or -1 if an error occurs. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a770817e273c68fb830f9f029c39fc41c"></a><!-- doxytag: member="SdFile::printField" ref="a770817e273c68fb830f9f029c39fc41c" args="(int32_t value, char term)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int SdBaseFile::printField </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">int32_t </td>
|
||
|
<td class="paramname"><em>value</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char </td>
|
||
|
<td class="paramname"><em>term</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Print a number followed by a field terminator. </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The number to be printed. </td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">term</td><td>The field terminator. Use '\n' for CR LF. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of bytes written or -1 if an error occurs. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a65604a3450e69799f2969b6a145647dc"></a><!-- doxytag: member="SdFile::printModifyDateTime" ref="a65604a3450e69799f2969b6a145647dc" args="(Print *pr)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::printModifyDateTime </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">Print * </td>
|
||
|
<td class="paramname"><em>pr</em></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Print a file's modify date and time</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">pr</td><td>Print stream for output.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="acb64cd7f69705eb269bfab8e6372e86b"></a><!-- doxytag: member="SdFile::printName" ref="acb64cd7f69705eb269bfab8e6372e86b" args="(Print *pr)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::printName </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">Print * </td>
|
||
|
<td class="paramname"><em>pr</em></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Print a file's name</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">pr</td><td>Print stream for output.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a239cacb867f6c4f93eb52c38c60684d7"></a><!-- doxytag: member="SdFile::printName" ref="a239cacb867f6c4f93eb52c38c60684d7" args="()" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::printName </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Print a file's name to stdOut</p>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a145595e55db1629fa126ffa2628fe9eb"></a><!-- doxytag: member="SdFile::read" ref="a145595e55db1629fa126ffa2628fe9eb" args="()" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int16_t SdBaseFile::read </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Read the next byte from a file.</p>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="aa70609890c15df7c49d65b07d1161a3f"></a><!-- doxytag: member="SdFile::read" ref="aa70609890c15df7c49d65b07d1161a3f" args="(void *buf, size_t nbyte)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int SdBaseFile::read </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">void * </td>
|
||
|
<td class="paramname"><em>buf</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">size_t </td>
|
||
|
<td class="paramname"><em>nbyte</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Read data from a file starting at the current position.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>Pointer to the location that will receive the data.</td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">nbyte</td><td>Maximum number of bytes to read.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ae5dd9c5f9764db71c90c5fcfb02b2c97"></a><!-- doxytag: member="SdFile::readDir" ref="ae5dd9c5f9764db71c90c5fcfb02b2c97" args="(dir_t *dir)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int8_t SdBaseFile::readDir </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="structdirectory_entry.html">dir_t</a> * </td>
|
||
|
<td class="paramname"><em>dir</em></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Read the next directory entry from a directory file.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[out]</td><td class="paramname">dir</td><td>The dir_t struct that will receive the data.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a4951400870f3f5ed8cc3f46b69388ed7"></a><!-- doxytag: member="SdFile::remove" ref="a4951400870f3f5ed8cc3f46b69388ed7" args="(SdBaseFile *dirFile, const char *path)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::remove </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> * </td>
|
||
|
<td class="paramname"><em>dirFile</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"><em>path</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [static, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Remove a file.</p>
|
||
|
<p>The directory entry and all data for the file are deleted.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">dirFile</td><td>The directory that contains the file. </td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">path</td><td>Path for the file to be removed.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="note"><dt><b>Note:</b></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>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a6e88ee210c9bd7556477c0e7ba4de1bb"></a><!-- doxytag: member="SdFile::remove" ref="a6e88ee210c9bd7556477c0e7ba4de1bb" args="()" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::remove </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Remove a file.</p>
|
||
|
<p>The directory entry and all data for the file are deleted.</p>
|
||
|
<dl class="note"><dt><b>Note:</b></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>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ad6e9f07c62add23dfe0338bdd0bf2d40"></a><!-- doxytag: member="SdFile::rename" ref="ad6e9f07c62add23dfe0338bdd0bf2d40" args="(SdBaseFile *dirFile, const char *newPath)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::rename </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> * </td>
|
||
|
<td class="paramname"><em>dirFile</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"><em>newPath</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Rename a file or subdirectory.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">dirFile</td><td>Directory for the new path. </td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">newPath</td><td>New path name for the file/directory.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a7a5369b40eb15ad26c2e4af5d069c52c"></a><!-- doxytag: member="SdFile::rewind" ref="a7a5369b40eb15ad26c2e4af5d069c52c" args="()" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void SdBaseFile::rewind </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td><code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Set the file's current position to zero. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a7268834187e8216605963f8ae3cf1e6e"></a><!-- doxytag: member="SdFile::rmdir" ref="a7268834187e8216605963f8ae3cf1e6e" args="()" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::rmdir </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Remove a directory file.</p>
|
||
|
<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>
|
||
|
<dl class="note"><dt><b>Note:</b></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>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a4186ba79c83005971096966c0fd02d46"></a><!-- doxytag: member="SdFile::rmRfStar" ref="a4186ba79c83005971096966c0fd02d46" args="()" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::rmRfStar </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Recursively delete a directory and all contained files.</p>
|
||
|
<p>This is like the Unix/Linux 'rm -rf *' if called with the root directory hence the name.</p>
|
||
|
<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>
|
||
|
<dl class="note"><dt><b>Note:</b></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>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ab04ec7e129607973f6e3436f779b6501"></a><!-- doxytag: member="SdFile::seekCur" ref="ab04ec7e129607973f6e3436f779b6501" args="(int32_t offset)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::seekCur </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">int32_t </td>
|
||
|
<td class="paramname"><em>offset</em></td><td>)</td>
|
||
|
<td><code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<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>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>The new position in bytes from the current position. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>true for success or false for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a6f42e496b179dbdd2c09083cfad28613"></a><!-- doxytag: member="SdFile::seekEnd" ref="a6f42e496b179dbdd2c09083cfad28613" args="(int32_t offset=0)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::seekEnd </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">int32_t </td>
|
||
|
<td class="paramname"><em>offset</em> = <code>0</code></td><td>)</td>
|
||
|
<td><code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<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>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>The new position in bytes from end-of-file. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>true for success or false for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="afe6aeaf0ca7573ceb8bb335c802dab16"></a><!-- doxytag: member="SdFile::seekSet" ref="afe6aeaf0ca7573ceb8bb335c802dab16" args="(uint32_t pos)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::seekSet </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">uint32_t </td>
|
||
|
<td class="paramname"><em>pos</em></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Sets a file's position.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<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>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a71170390855df02c88cbda6e727e9609"></a><!-- doxytag: member="SdFile::setpos" ref="a71170390855df02c88cbda6e727e9609" args="(FatPos_t *pos)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void SdBaseFile::setpos </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="struct_fat_pos__t.html">FatPos_t</a> * </td>
|
||
|
<td class="paramname"><em>pos</em></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>set position for streams </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[out]</td><td class="paramname">pos</td><td>struct with value for new position </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a292247972772be832f2c6ea166f4049a"></a><!-- doxytag: member="SdFile::sync" ref="a292247972772be832f2c6ea166f4049a" args="()" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::sync </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<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>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ae55ad6000c44fc73e15934381b305dc4"></a><!-- doxytag: member="SdFile::timestamp" ref="ae55ad6000c44fc73e15934381b305dc4" args="(uint8_t flag, uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::timestamp </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>flags</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint16_t </td>
|
||
|
<td class="paramname"><em>year</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>month</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>day</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>hour</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>minute</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>second</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Set a file's timestamps in its directory entry.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<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>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<p>T_ACCESS - Set the file's last access date.</p>
|
||
|
<p>T_CREATE - Set the file's creation date and time.</p>
|
||
|
<p>T_WRITE - Set the file's last write/modification date and time.</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">year</td><td>Valid range 1980 - 2107 inclusive.</td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">month</td><td>Valid range 1 - 12 inclusive.</td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">day</td><td>Valid range 1 - 31 inclusive.</td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">hour</td><td>Valid range 0 - 23 inclusive.</td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">minute</td><td>Valid range 0 - 59 inclusive.</td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">second</td><td>Valid range 0 - 59 inclusive</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>It is possible to set an invalid date since there is no check for the number of days in a month.</dd>
|
||
|
<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>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="adf84a0487f3b45fc183756b9d17141cd"></a><!-- doxytag: member="SdFile::timestamp" ref="adf84a0487f3b45fc183756b9d17141cd" args="(SdBaseFile *file)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::timestamp </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="class_sd_base_file.html">SdBaseFile</a> * </td>
|
||
|
<td class="paramname"><em>file</em></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Copy a file's timestamps</p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">file</td><td>File to copy timestamps from.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="note"><dt><b>Note:</b></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>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The value one, true, is returned for success and the value zero, false, is returned for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a9d1ad1abbd90089f731de81de1708c19"></a><!-- doxytag: member="SdFile::truncate" ref="a9d1ad1abbd90089f731de81de1708c19" args="(uint32_t size)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool SdBaseFile::truncate </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">uint32_t </td>
|
||
|
<td class="paramname"><em>length</em></td><td>)</td>
|
||
|
<td><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<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>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">length</td><td>The desired length for the file.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a1555e6866abc9c867c5fff189a3a4317"></a><!-- doxytag: member="SdFile::type" ref="a1555e6866abc9c867c5fff189a3a4317" args="() const " -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">uint8_t SdBaseFile::type </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const<code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<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>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The file or directory type. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="acb021c2b7f68778d683d093775532a06"></a><!-- doxytag: member="SdFile::volume" ref="acb021c2b7f68778d683d093775532a06" args="() const " -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname"><a class="el" href="class_sd_volume.html">SdVolume</a>* SdBaseFile::volume </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td> const<code> [inline, inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<dl class="return"><dt><b>Returns:</b></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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a7329a9bde292b3baad6d6dfbd72afe90"></a><!-- doxytag: member="SdFile::write" ref="a7329a9bde292b3baad6d6dfbd72afe90" args="(const void *buf, size_t nbyte)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int SdFile::write </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const void * </td>
|
||
|
<td class="paramname"><em>buf</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">size_t </td>
|
||
|
<td class="paramname"><em>nbyte</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Write data to an open file.</p>
|
||
|
<dl class="note"><dt><b>Note:</b></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>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>Pointer to the location of the data to be written.</td></tr>
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">nbyte</td><td>Number of bytes to write.</td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>For success <a class="el" href="class_sd_file.html#a67267a4b63d03a16e099195935613006">write()</a> returns the number of bytes written, always <em>nbyte</em>. If an error occurs, <a class="el" href="class_sd_file.html#a67267a4b63d03a16e099195935613006">write()</a> returns -1. Possible errors include <a class="el" href="class_sd_file.html#a67267a4b63d03a16e099195935613006">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>
|
||
|
|
||
|
<p>Reimplemented from <a class="el" href="class_sd_base_file.html#a874e3bae567f96bed5ad442beb846a61">SdBaseFile</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a489af4bffef36ee4c22d422ba68b1b00"></a><!-- doxytag: member="SdFile::write" ref="a489af4bffef36ee4c22d422ba68b1b00" args="(const char *str)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int SdFile::write </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"><em>str</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Write a string to a file. Used by the Arduino Print class. </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">str</td><td>Pointer to the string. Use getWriteError to check for errors. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>count of characters written for success or -1 for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a67267a4b63d03a16e099195935613006"></a><!-- doxytag: member="SdFile::write" ref="a67267a4b63d03a16e099195935613006" args="(uint8_t b)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">size_t SdFile::write </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">uint8_t </td>
|
||
|
<td class="paramname"><em>b</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Write a byte to a file. Required by the Arduino Print class. </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">b</td><td>the byte to be written. Use getWriteError to check for errors. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>1 for success and 0 for failure. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="adaa153fed109a0a03cfd545a259de4fe"></a><!-- doxytag: member="SdFile::write_P" ref="adaa153fed109a0a03cfd545a259de4fe" args="(PGM_P str)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void SdFile::write_P </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">PGM_P </td>
|
||
|
<td class="paramname"><em>str</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Write a PROGMEM string to a file. </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">str</td><td>Pointer to the PROGMEM string. Use getWriteError to check for errors. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ad760d51410f36fd1e1b005a754624954"></a><!-- doxytag: member="SdFile::writeln_P" ref="ad760d51410f36fd1e1b005a754624954" args="(PGM_P str)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void SdFile::writeln_P </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">PGM_P </td>
|
||
|
<td class="paramname"><em>str</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Write a PROGMEM string followed by CR/LF to a file. </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramdir">[in]</td><td class="paramname">str</td><td>Pointer to the PROGMEM string. Use getWriteError to check for errors. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr/><h2>Member Data Documentation</h2>
|
||
|
<a class="anchor" id="a47d4ba2177ffcd99c2387f9fac182d5b"></a><!-- doxytag: member="SdFile::writeError" ref="a47d4ba2177ffcd99c2387f9fac182d5b" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool <a class="el" href="class_sd_base_file.html#a47d4ba2177ffcd99c2387f9fac182d5b">SdBaseFile::writeError</a><code> [inherited]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<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>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr/>The documentation for this class was generated from the following files:<ul>
|
||
|
<li>Arduino/libraries/SdFat/<a class="el" href="_sd_file_8h.html">SdFile.h</a></li>
|
||
|
<li>Arduino/libraries/SdFat/SdFile.cpp</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<hr class="footer"/><address class="footer"><small>Generated on Thu Feb 7 2013 12:51:22 for SdFat by 
|
||
|
<a href="http://www.doxygen.org/index.html">
|
||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
|
||
|
</body>
|
||
|
</html>
|