Page 1 of 1

Copy and paste a file on SDcard?

Posted: Fri Sep 13, 2013 10:48 pm
by RobH
Can anyone give pointers on copying and pasting a file from an SDcard to the same SDcard? I have been in a discussion with my Flowcode sparring partner about it today (we're both learning FC) and I think you have to do it in steps, like:

write file1 name to string1
make file2 name with string2 (modified string derived from string1 )
open file1 and copy contents to string3
open file2 and write string3

Thanks,
-Rob

Re: Copy and paste a file on SDcard?

Posted: Tue Sep 17, 2013 3:17 pm
by Benj
Hi Rob,

Which version of Flowcode are you using?

In v5.5 and v6 I added a option for simultaneous files to be manipulated allowing you to copy from one file to another without having to keep: opening file A, moving to the next uncopied sector, reading the data, opening file B, moving to the next free sector, writing the data.

Re: Copy and paste a file on SDcard?

Posted: Tue Sep 17, 2013 6:15 pm
by RobH
FC6 trial, PIC pack, and soon to be Pro pack. I'm loving this programming environment, btw!

Re: Copy and paste a file on SDcard?

Posted: Thu Sep 19, 2013 10:58 am
by Benj
Hello Rob,

Here is a quick example I've put together. Not tested it but I think it should work ok.

Re: Copy and paste a file on SDcard?

Posted: Thu Sep 19, 2013 1:49 pm
by RobH
Thanks Ben. I'll check this out today.

Re: Copy and paste a file on SDcard?

Posted: Fri Sep 20, 2013 1:20 am
by RobH
I checked you code and it kind of works, if you run the simulation twice. The first run of the simulation will successfully make the text file but doesn't add the text therein. If you run a second time, it will write the text. I haven't tried it on real hardware yet.

-Rob

Re: Copy and paste a file on SDcard?

Posted: Fri Sep 20, 2013 9:15 am
by Benj
Hi Rob,

That's interesting, wonder if you need a delay just after creating the file for the sim to work correctly first time.

Re: Copy and paste a file on SDcard?

Posted: Fri Sep 20, 2013 1:49 pm
by RobH
That's what I was going to try next. I'll let you know what I come up with...