Thread: Basic file io
View Single Post
Old 04-07-2017, 05:35 PM   #11
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,034
Default

Quote:
Originally Posted by ynohtna View Post
Your second call to strcpy overwrites your buffer contents (the result of GetResourcePath()) with "wdl_test_file.txt" because it's using strcpy again.

That second call should be using strcat instead. I'm sure you'll work out why if you look up the docs for strcpy & strcat.
Or just use snprintf...

Code:
char buf[4096]; // might not be enough for extreme cases but enough for most cases...
snprintf(buf,sizeof(buf),"%s/testfile.txt", GetResourcePath());
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/
Xenakios is online now   Reply With Quote