forked from greiman/SdFat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WorkingDirectory.txt
44 lines (30 loc) · 1.6 KB
/
WorkingDirectory.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Relative paths in SdFat are resolved in a manner similar to Windows.
Each instance of SdFat has a current directory. In SdFat this directory
is called the volume working directory, vwd. Initially this directory is
the root directory for the volume.
The volume working directory is changed by calling SdFat::chdir(path).
The call sd.chdir("/2011") will change the volume working directory
for sd to "/2011", assuming "/2011" exists.
Relative paths for SdFat member functions are resolved by starting at
the volume working directory.
For example, the call sd.mkdir("APRIL") will create the directory
"/2011/APRIL" assuming the volume working directory is "/2011".
SdFat has a current working directory, cwd, that is used to resolve paths
for file.open() calls.
For a single SD card the current working directory is always the volume
working directory for that card.
For multiple SD cards the current working directory is set to the volume
working directory of a card by calling the SdFat::chvol() member function.
The chvol() call is like the Windows <drive letter>: command.
The call sd2.chvol() will set the current working directory to the volume
working directory for sd2.
If the volume working directory for sd2 is "/MUSIC" the call
file.open("BIGBAND.WAV", O_READ);
will then open "/MUSIC/BIGBAND.WAV" on sd2.
The following functions are used to change or get current directories.
See the html documentation for more information.
bool SdFat::chdir(bool set_cwd = false);
bool SdFat::chdir(const char* path, bool set_cwd = false);
void SdFat::chvol();
SdBaseFile* SdFat::vwd();
static SdBaseFile* SdBaseFile::cwd();