有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

linux如何使用Java扫描根目录中的SUID文件并访问其属性?

我是UNIX系统的新手。 我的任务是在根目录中找到一个SUID文件,并访问它的文件属性来完成一些事情

我是否可以编写一个基于Java的应用程序来搜索带有粘性位的文件并访问其属性(文件权限/创建日期等)

**有人要求我不要为此在UNIX中使用“find”命令

请帮忙


共 (1) 个答案

  1. # 1 楼答案

    Interface PosixFileAttributeView文档:

    The permissions attribute is a set of access permissions. This file attribute view provides access to the nine permission defined by the PosixFilePermission class. These nine permission bits determine the read, write, and execute access for the file owner, group, and others (others meaning identities other than the owner and members of the group). Some operating systems and file systems may provide additional permission bits but access to these other bits is not defined by this class in this release.

    这意味着您实际上无法在Java中访问这些位(setuid和setgid)。请记住,Java与操作系统无关,并且这些权限是特定于POSIX的