Making directories???

I am pretty sure you can make your own folder/directorie with pascal. The only problem is i don't know how to. I want to make a folder to put saved files in. So along with making one I would like to know how to hide it, if you can. that way they can't change there stats by getting acess to it. thanks alot!!! Wizarbo

Comments

[b][red]This message was edited by zibadian at 2003-3-18 3:27:27[/red][/b][hr]: I am pretty sure you can make your own folder/directorie with pascal. The only problem is i don't know how to. I want to make a folder to put saved files in. So along with making one I would like to know how to hide it, if you can. that way they can't change there stats by getting acess to it. thanks alot!!! : Wizarbo: Check out MkDir(), SetFAttr(), and faHidden in the help files. This can still allow the user to edit the data files, but it is slightly more difficult. There are better ways to do this, for example a CRC type check (source code is somewhere on this site).

: I am pretty sure you can make your own folder/directorie with pascal. The only problem is i don't know how to. I want to make a folder to put saved files in. So along with making one I would like to know how to hide it, if you can. that way they can't change there stats by getting acess to it. thanks alot!!! : Wizarbo:

Other have already taken care of the Directory creation and hiding. Zibadian mentioned CRC checks which are a good idea as well. The other method I like to use is encryption. It doesn't have to be very good, but it will keep most people from editing their data. Here's a quick example of the normal input and a quick encoding program I wrote:[code] Name : Phat Nat MALE 24 Programmer Encoded : ++--_-+-+_ +5)?QESB Decoded : Phat Nat MALE 24 ProgrammerORD Values of Encoded: 174 168 183 190 185 209 205 220 230 203 162 189 194 183 227 241 237 0 218 53 41 29 246 81 69 83 66[/code][b]BTW If anyone can figure out my encoding scheme, I'd love to know. You will need to copy and paste this into a file and open it in DOS where it can be seen correctly. I have also included the ORD value of the encoded bytes (decimal form) in case that doesn't work.[/b]

Anyways, this is just a quick example and can easily be put into a game for storing data. Just another idea ;-)