Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

how to create and save a text file for io read in later?

GibGib
edited September 2013 in Questions Posts: 59

My wargame will allow you to pick the map to fight on.

Ok I found this: http://twolivesleft.com/Codea/Talk/discussion/3031/save-file-directly-on-dropbox/p1

I need to transfer a file from my pc to the directory where text files are saved - how would I do that? I know I was able to load my own sprites and found the posts showing how to load into the Codea sync'd dropbox but since the post above mentions a directory(local file = os.getenv("HOME").."/Documents/Dropbox.spritepack/myFile1.txt"), how do i get a window open to it and get my file from my pc to there?

Thanks!
Gib

Tagged:

Comments

  • dave1707dave1707 Mod
    Posts: 7,520

    @Gib Do you have Dropbox on your PC and is it sync'd with your iPad. Anything you put in the Dropbox file on your PC should show on the iPad once you do the sync. There's more info in the link you posted above.

  • GibGib
    edited September 2013 Posts: 59

    I syncd it after I pasted in my map.txt file but don't see it in the codea Dropbox..? I only see my graphics files

  • dave1707dave1707 Mod
    Posts: 7,520

    @Gib Unfortunatly, only files with a .png extension show in the Dropbox sprite area. The file is there, but doesn't show. Try reading the file even though you don't see it.

  • GibGib
    Posts: 59

    @dave ty sir. Is that a bug then?

  • GibGib
    Posts: 59

    or if not a bug, can we get make a folder so it shows every kind of file?

  • Jmv38Jmv38 Mod
    Posts: 3,295

    @Gig not for now, unforunately. It might even be against the rules of Apple.

  • dave1707dave1707 Mod
    Posts: 7,520

    @Gib One thing you can do is instead of making your files .txt, make them .png . That way they will show up in the folder for you to see and you can still read them. One thing, make sure you delete any file that you created as .txt because they will be there forever and you won't see them on the iPad. They'll just use up memory.

  • dave1707dave1707 Mod
    Posts: 7,520

    @Gib One other thing you might consider is naming your file something like "nameTxt.png". That way when you look at the sprite pack you can see which are true png and which are just txt. Even though they will show in the sprite pack as a png without an image and a 0x0 size, when you do a spritelist(), you'll be able to identify them as txt by the name. @Simeon, is there any reason why you can't show all the files with their .extension .

  • GibGib
    Posts: 59

    @Jmv38 What does Apple have against showing files other than png's? I don't understand.

  • GibGib
    Posts: 59

    @dave1707 roger that, I'll change to .png but I don't understand why only those show?

  • dave1707dave1707 Mod
    Posts: 7,520

    @Gib @Jmv38 I don't think Apple has anything against showing files. Before I switched to Codea, I was coding with iLuaBox Pro. That had file io that did directories, folders, and anything else to do with files. It was very similar to the file system on a PC. There was even SQL library code for working with databases.

  • @Gib Apple doesn't want people exploring the file systems of iOS, or installing any other OS. Therefore they locked everything down so you can only use their software or applications from the App Store (which they can gaurantee has no apps for accessing the file system). Then came Jailbreaking. Look it up.

    As for why Apple doesn't want it, it's because if you had freedom and installed whatever the heck you wanted, they would get less money, because you wouldn't use their stuff. Also, they want to insure no viruses, inappropriate apps, etc.

    Basically: money, control, and power.

Sign In or Register to comment.