创建一个只读文件 [英] Create a read-only file

查看:138
本文介绍了创建一个只读文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以在创建时创建或模拟一个内容集的文件,并确保没有人能改变文件。
如果可能,我可以在java中执行吗?

解决方案

设置文件为只读所以没有人能改变它。大约需要3秒钟来取消只读标志。然后可以在十六进制编辑器或其他可以处理文件类型的程序中打开该文件,并且可以进行更改。

I was wondering wether it is possible to create or simulate a file with a content set at creation and the assurance that nobody can ever change the file. If possible, can I do it in java?

解决方案

Setting a file to read only is not going to make it so no one can ever change it. It takes about 3 seconds to unset the read only flag. The file can then be opened in a hex editor or other program that can handle the file type and changes can be made.

这篇关于创建一个只读文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆