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
Copy and paste a file on SDcard?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Copy and paste a file on SDcard?
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- RobH
- Posts: 95
- Joined: Wed Sep 11, 2013 7:51 pm
- Has thanked: 29 times
- Been thanked: 17 times
- Contact:
Re: Copy and paste a file on SDcard?
FC6 trial, PIC pack, and soon to be Pro pack. I'm loving this programming environment, btw!
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Copy and paste a file on SDcard?
Hello Rob,
Here is a quick example I've put together. Not tested it but I think it should work ok.
Here is a quick example I've put together. Not tested it but I think it should work ok.
- Attachments
-
- FAT File Copy.fcfx
- (12.71 KiB) Downloaded 224 times
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- RobH
- Posts: 95
- Joined: Wed Sep 11, 2013 7:51 pm
- Has thanked: 29 times
- Been thanked: 17 times
- Contact:
- RobH
- Posts: 95
- Joined: Wed Sep 11, 2013 7:51 pm
- Has thanked: 29 times
- Been thanked: 17 times
- Contact:
Re: Copy and paste a file on SDcard?
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
-Rob
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Copy and paste a file on SDcard?
Hi Rob,
That's interesting, wonder if you need a delay just after creating the file for the sim to work correctly first time.
That's interesting, wonder if you need a delay just after creating the file for the sim to work correctly first time.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- RobH
- Posts: 95
- Joined: Wed Sep 11, 2013 7:51 pm
- Has thanked: 29 times
- Been thanked: 17 times
- Contact:
Re: Copy and paste a file on SDcard?
That's what I was going to try next. I'll let you know what I come up with...