SapFlow Probe
A low-cost HRM probe for measuring a tree's water consumption
sd_log.cpp
Go to the documentation of this file.
1 #include "sd_log.h"
2 
4 
5 String newfile( String fname, String suffix ){
6  String temp = fname + suffix; //< Start with the name provided
7  int i = 0;
8  // Try appending a number
9  while(sd.exists(temp.c_str())){
10  // If the first number didn't work, keep trying
11  // Note that this will hang if 00 through 99 are all taken
12  ++i;
13  char ones = i%10 + '0';
14  char tens = i/10 + '0';
15  temp = fname + '(' + tens + ones + ')' + suffix;
16  }
17  return temp;
18 }
newfile
String newfile(String fname, String suffix)
Avoids file conflicts by renaming.
Definition: sd_log.cpp:5
sd
static SdFat sd
File system object.
Definition: sd_log.h:14
sd_log.h