Android Question Newbie - problem transferring from SD card to File.DirInternal

BrianM

New Member
Licensed User
Hi all,
This is no doubt a dumb question but to me it's a problem. I'm trying to copy a "csv" file from the SD card back into File.DirInternal and then open it and read the data. The problem I'm hitting is that the file is located on the SD card and appears to transfer ok. When I check if it's there in "file.dirinternal" it says true/yes, but when I check the file size it's 0 bytes long.

I've attached the bit of code I'm using, which links to the ExternalStorage module I used to write the files out in the first place. That bit works fine, I can open & check the files on the SD card with a file browser so I know they are ok on the SD card.

Can someone tell me where I'm going wrong ? (and keep it VERY simple please ! :) )

Brian
 

Attachments

  • transfercode.txt
    935 bytes · Views: 175

drgottjr

Expert
Licensed User
Longtime User
input is automatically closed, but i think you have to close the output yourself. file is created when you open the stream. but closing streams flushes buffers. give it a try
 
Upvote 0

BrianM

New Member
Licensed User
:)

There ought to be a smiley jumping up and down because you folks have just solved a problem I've been battling with all week ! I didn't realise you had to flush/close afterwards but as they say, "every day is a school day" and I've learned something yet again.

Thank you both very, very much.

Brian
 
Upvote 0
Top