ok, so..
im using the RTCC date for filename of a file on an SD card.
problem im having, im using plib function RtccGetDate() this returns an unsigned long with all the date info..
however, the MDD filesystem uses a char array/pointer to a char array, for the filename.. therefore its not liking one version, im unsure how to change the type, tried using strncpy..
heres the code snippet:
Variables:
Code:
Other Question is this:
when use strncpy() does it append? lets say i do what iv done above, then want to put something else on the end.. could i use strncpy(fileName, SomethingElse);? and SomethingElse be at the end? as long as it is within the array length..
Hope this makes sense.. any questions, please ask, all feedback welcomed.
im using the RTCC date for filename of a file on an SD card.
problem im having, im using plib function RtccGetDate() this returns an unsigned long with all the date info..
however, the MDD filesystem uses a char array/pointer to a char array, for the filename.. therefore its not liking one version, im unsure how to change the type, tried using strncpy..
heres the code snippet:
Variables:
Rich (BB code):
unsigned char fileNAME[30];
Rich (BB code):
FSchdir("\\Logs");
rtccDate=(RtccGetDate());
strncpy(fileNAME, rtccDate);
FilePoint = FSfopen(fileNAME, "a+"); //Opens fileNAME and appends to the end
when use strncpy() does it append? lets say i do what iv done above, then want to put something else on the end.. could i use strncpy(fileName, SomethingElse);? and SomethingElse be at the end? as long as it is within the array length..
Hope this makes sense.. any questions, please ask, all feedback welcomed.
Last edited: