Board index » cppbuilder » Protect files from opening
bar
![]() CBuilder Developer |
bar
![]() CBuilder Developer |
Protect files from opening2007-10-29 12:17:38 AM cppbuilder14 Hello I have an app which download and create some graphic files (.jpg,.gif etc) to the local disk of the user. Is there any way to prevent opening files manually by user. changing extension or something. Regards SA |
Clayton Arends
![]() CBuilder Developer |
2007-10-29 12:32:50 AM
Re:Protect files from openingQuoteIs there any way to prevent opening files manually by user. changing drop the first letter, reverse the letter ordering, etc. ie. "_if" or "fig" for "gif" That solves the problem of double-click loading but a person could still rename the file and load. To protect against that you could encrypt/encode/compress the files before writing them to disk. However, unless the images are of sensitive nature going through the hassle usually isn't worth it. Clayton |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2007-10-30 01:37:40 AM
Re:Protect files from opening
"bar" < XXXX@XXXXX.COM >wrote in message
QuoteI have an app which download and create some graphic files You could try compressing the files into an archive file, such as a .zip file, and then password-protect it. Or encrypt the files during downloading and then decrypt them whenever your app needs to use them. What exactly are you trying to prevent? Gambit {smallsort} |
bar
![]() CBuilder Developer |
2007-10-31 03:02:42 PM
Re:Protect files from openingQuoteWhat exactly are you trying to prevent? SA |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2007-11-01 03:00:16 AM
Re:Protect files from opening
"bar" < XXXX@XXXXX.COM >wrote in message
QuoteI want to prevent file from editing. 2) open the file for exclusive access at the time you download it. This will only work while the downloading app is running, though. Once the file is closed, the user can access it. 3) lock the file contents via LockFile/Ex(). Again, this only works until the file is closed. 4) change the permissions on the file after downloading it (which will likely require the downloading app to have admin rights) so the user can't access the file at all. This introduces a timing issue, though, since the user could get to the file before the app can update it. Gambit |
Ed Mulroy [TeamB]
![]() CBuilder Developer |
2007-11-01 06:58:36 AM
Re:Protect files from opening
Wouldn't ACL be able to lock it from access by other users?
. Ed QuoteRemy Lebeau wrote in message news:4728d30e$ XXXX@XXXXX.COM ... |
bar
![]() CBuilder Developer |
2007-11-12 12:33:32 AM
Re:Protect files from opening
Hi Remy
Thanks for reply. Is there any way to do this. I have a folder "Test" say in C:\Windows\Temp\Test where i have some images. Either my appliation is running or not. can i prevent the user without opening this folder or accessing this folder. SA |
Barry
![]() CBuilder Developer |
2007-11-13 12:45:34 AM
Re:Protect files from opening
I have a similar requirement but for text data files, that need to be non
user editable. Ie Binary. Does anyone still use binary file formats? Last time I looked at that was dos days, and using Turbo Basic. "bar" < XXXX@XXXXX.COM >wrote in message QuoteHi Remy |
Chris Uzdavinis (TeamB)
![]() CBuilder Developer |
2007-11-13 02:24:08 AM
Re:Protect files from opening
"Barry" < XXXX@XXXXX.COM >writes:
QuoteI have a similar requirement but for text data files, that need to The usual way to prevent access to a file is through file permissions, which is pretty much outside of C++, and now into OS features. -- Chris (TeamB); |
Harry
![]() CBuilder Developer |
2007-11-13 04:27:50 AM
Re:Protect files from opening
Hello,
Have you evaluate that files could be corrupted and just have to test them by CRC computing ? |
Barry
![]() CBuilder Developer |
2007-11-13 01:34:40 PM
Re:Protect files from opening
Chris Uzdavinis (TeamB) wrote:
Quote"Barry" < XXXX@XXXXX.COM >writes: file contents, but the controlling authority responsible for approval of the software now requires certain input data to be hidden from the user, or not readily editable. Would you recommend binary, or file permissions. I guess file permissions could be easier, in that I don't have to change my code, but can one ship a file, say via email, that has a built in permission. I doubt it. It is something that has to be set up on each computer on which it is installed....right? |