cheapbag214s
Kapitan jachtowy
Dołączył: 27 Cze 2013
Posty: 20086
Przeczytał: 0 tematów
Ostrzeżeń: 0/5 Skąd: England
|
Wysłany: Pon 17:14, 26 Sie 2013 Temat postu: Ruby and shoes writing and reading txt files |
|
|
Ruby and shoes writing and reading txt files
I made a timer which puts the timed amount into a txt file as a log. It also keeps an all time running total in a separate txt file. It works as I want it to,[link widoczny dla zalogowanych].
I tried packaging it:
This working copy seems to operate without txt files (they are somehow built-in. Is there a way to package this so I still have access to the associated txt files,[link widoczny dla zalogowanych]. (maybe has something to do with the paths,[link widoczny dla zalogowanych].)
The current path also is set to this tmp directory, which also includes the txt files you bundled into the app, in it's original state. If you change the content of the files during the app execution,[link widoczny dla zalogowanych], and restart the app, your changes are gone, because in the new created tmp dir, there is a fresh copy of the original txt files. so far,[link widoczny dla zalogowanych], it is a BAD idea to put your data files (txt in your case,[link widoczny dla zalogowanych], or SQLITE-database-files,[link widoczny dla zalogowanych], or config files,[link widoczny dla zalogowanych], .) into the bundles app.
Better way:
create a "hidden" folder (folder's name should start with an ".") in the user's home folder. On windows it should be something like "c:\Users\YourName". Create there everything you need,[link widoczny dla zalogowanych], this directory won't be temporal,[link widoczny dla zalogowanych], so you can access it everytime without problems. This should general be a better solution when programming desktop stuff, not just while using shoes.
相关的主题文章:
[link widoczny dla zalogowanych]
[link widoczny dla zalogowanych]
[link widoczny dla zalogowanych]
[link widoczny dla zalogowanych]
[link widoczny dla zalogowanych]
[link widoczny dla zalogowanych]
[link widoczny dla zalogowanych]
[link widoczny dla zalogowanych]
[link widoczny dla zalogowanych]
[link widoczny dla zalogowanych]
[link widoczny dla zalogowanych]
[link widoczny dla zalogowanych]
[link widoczny dla zalogowanych]
http://www.drshogun.fora.pl/gsm,8/bell-donald-in-just-augusta,9534.html#9916
[link widoczny dla zalogowanych]
Post został pochwalony 0 razy
|
|