@everyone ,
The part of the above code that is SSK, is this function: io.appendFile()
This is an io.* extension added by SSK that lets you append content to an existing file (or create it if the file does not exist yet) in any of the standard system.* directories, excluding system.ResourceDirectory which is generally not writable.
This extension is not intended for the user @pabloapdz is using it for. However it will likely still work.
I think the real question ‘@pabloapdz’ is asking here is, “What is a path, in Android, that is universally the same, and can be accessed both from an app and from a PC when plugged into the phone with a USB cable?”
I don’t think there is a universal answer to this question, but if anyone has it, please share.
@pabloapdz,
You and I have an ongoing discussion about this here: https://forums.coronalabs.com/topic/70139-csv-file-with-corona/
I’m cool continuing this discussion here, but generally it is frowned upon to start a new thread if one is on-going.
Having said that, your other thread started about another topic and veered into this one so, again I’m OK continuing here.
So, continuing and re-iterating what I said in the other thread:
To have ANY hope of this working, you need to Identify and create a string containing the complete path you want to write to.
You can use SSK files.* to help with this, but you don’t need to.
The key functions that might help are:
- ssk.files.util.repairPath( _ path _ ) - Where ‘_ path _’ is the full path and filename you want to write to. This function ensures it meets the slash-standard for the OS you are on. So, it is optional.
- ssk.files.util.writeFile( _ content , _ path _ ) - Where ’ content ’ is a string,number or previously read content and ’ path _’ is the full path and filename you want to write to.
- This is not that special, but it does ensure you’re using ‘wb’ attribute when writing.