如何对文件强制执行 READ_ONCE_ONLY 内置控制?
如何控制对硬盘驱动器中文件的访问,使其只能读取一次。第一次访问后,该文件应变得不可访问。
How to control access to a file in hard drive so that it can be read once only. After the first access, the file should be rendered inaccessible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这通常不是由操作系统实现的。但是,它可以通过编程来完成。
假设用户 A 正在尝试读取文件 F。我们希望将 F 的读取限制为一次。文件F的所有者是用户B。文件F被提供对程序的读访问(例如通过保留程序B的所有者,并且仅允许对所有者的读访问)。该程序可用于读取文件的内容并将其打印在控制台上。当程序运行时,它还会在硬盘中创建一个文件F2。它始终检查文件 F2 是否存在,否则不允许读取文件 F。
I don't think this is implemented by the operating systems usually. However, it can be done programmically.
Suppose user A is trying to read the file F. We want the reading of F to be restricted to once only. The owner of the file F is user B. The file F is provided a read access to a program (for example by keeping the owner of the program B, and allowing read access to the owner only). The program can be used to read the content of the file and print it on the console. When the program runs, it also creates a file F2 in the hard disk. It always checks that if this file F2 is present, it disallows reading the file F.