Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8051

SDK • Re: Need help with SDK and newlib.

$
0
0
I've worked out the problem with unlink or more to me accurate rename. my previous rename function would delete the destination and then preform the file rename. newlib tries to make to run _link first and then _unlink ONLY if _link is successful which it won't be because the f_rename failed do to the file still existing. So I added an unlink before the rename and I see

Code:

_unlink(test)_link(FEMTO_T,test)_unlink(FEMTO_T)
all as it should be.
The problem is that in _link I used f_rename maybe this isn't correct or I should add the f_unlink into the _link to mimic the expected behaviour but this would cause the return value from rename to read as failure not success so I'm stuck, AI suggests that copying the file is the correct course of action.

And then there is puts it only appends a newline to a string and I need newline and carriage return. I can see no way to change this with newlib maybe I'm missing it except I did a cheeky #define puts(s) { puts(s); putchar('\r'); }

Statistics: Posted by DarkElvenAngel — Thu Dec 12, 2024 3:40 pm



Viewing all articles
Browse latest Browse all 8051

Trending Articles