protect text file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
protect text file
Hi
Can I protect a txt file thats outside of my standalone so it can't be altered by the user?
Any advice welcome
Many thanks, Jon.
Can I protect a txt file thats outside of my standalone so it can't be altered by the user?
Any advice welcome
Many thanks, Jon.
I dare not shake the dew drop from a rose lest I disturb the stars.
Re: protect text file
Most operating systems will allow you to make the file read-only, but you would have to configure it on each system.. The other option is to include it in the application..
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: protect text file
You might consider using the encrypt and decrypt functions.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: protect text file
Thank you both,
I'll look at both options
Regards, Jon
I'll look at both options
Regards, Jon
I dare not shake the dew drop from a rose lest I disturb the stars.
Re: protect text file
What is inside this text file ?jon wrote:Hi
Can I protect a txt file thats outside of my standalone so it can't be altered by the user?
Any advice welcome
Internal data used by your app ?
If it's the case, do you really need a text file ? You could put those data in a custom property, within a sub stack (that way, your app could "save" the data).
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: protect text file
Roger that.bangkok wrote:jon wrote:You could put those data in a custom property, within a sub stack (that way, your app could "save" the data).
Stack files make a great storage container, since the syntax for working with custom props is simple and robust, and you'll never have to worry about parsing.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: protect text file
Thanks guys
custom props are a bit over my head at the moment, but I would like some ideas of how please
I am simply needing to save 3 flds with text in them so they appear when I re-start my stand alone game.
Any pointers or psuedo code would be most welcome, thanks for taking your time to help.
By the way I got my txt file to encrypt, but I can't seem to get it to decrypt on import.
Regards, Jon.
custom props are a bit over my head at the moment, but I would like some ideas of how please
I am simply needing to save 3 flds with text in them so they appear when I re-start my stand alone game.
Any pointers or psuedo code would be most welcome, thanks for taking your time to help.
By the way I got my txt file to encrypt, but I can't seem to get it to decrypt on import.
Regards, Jon.
I dare not shake the dew drop from a rose lest I disturb the stars.
Re: protect text file
Jon- np: here's an development-time example example of putting text into a custom property which I'll call uGreeting.
then at runtime in your code when you need the text, just retrieve it from the custom property:
Code: Select all
put "hello, sailor" into field 1
set the uGreeting of this stack to field 1
Code: Select all
put the uGreeting of this stack into field 1
Re: protect text file
Hey thanks mwieder
You just made my day, I had no idea it was so straightforward, the flippin dictionary should be re written by you guys
Many thanks again, Jon
PS. How did you know I was a sailor
You just made my day, I had no idea it was so straightforward, the flippin dictionary should be re written by you guys

Many thanks again, Jon
PS. How did you know I was a sailor

I dare not shake the dew drop from a rose lest I disturb the stars.
Re: protect text file
Except be careful if the text will change. Standalones can't save changes to themselves so anything you put into that property during run time will be lost. If the text is static and is only set during development, you're fine.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: protect text file
...or just use a stack file not attached to your standalone.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 49
- Joined: Sat Jun 16, 2012 7:57 pm
Re: protect text file
Hi Jon,jon wrote:You just made my day, I had no idea it was so straightforward, the flippin dictionary should be re written by you guys
The Dictionary is not so bad, but it won't help you catching the spirit of LC and discovering this kind of feature.
Reading the user manual (from the help menu) is really useful.
Best regards,
Didier
Didier
Re: protect text file
Thanks for your advice
I have decided to go with the external stack, password protected because the data in the flds changes all the time.
I allways learn and sometimes get side tracked after the advice i get on here, but in a good way.
Thanks again all, Jon
I have decided to go with the external stack, password protected because the data in the flds changes all the time.
I allways learn and sometimes get side tracked after the advice i get on here, but in a good way.

Thanks again all, Jon
I dare not shake the dew drop from a rose lest I disturb the stars.
Re: protect text file
jon wrote:PS. How did you know I was a sailor


