English 中文(简体)
Java DTrace Bridge on OS X
原标题:Java DTrace bridge on OS X

I am trying to grab filesystem events on OS / Kernel level on OS X. There are 2 requirements i have to follow. The first one is to do this in java as the whole project im developing for is written in java. The second one is that i have to find out when a document is opened.

硫丹 我使用了代号——java,但我可以发现,在第十届特别协调员会议上,我的情况相当好。 此外,日本退休人员协会还未提供有用的约束力。 目前,Im通过经常叫“灯光”来避免追捕活动。 然而,这是一个坏的解决办法。

得到帮助。

问题回答

您可以使用SOSX,但由于需要根基的特权,因此,你不想投入一个系统的运行时间。

In any case, you won t be able to do this in pure Java (any Java API would be a wrapper around some lower level C introspection, and if you re doing it kernel-wide, would need to be done as root).

如果你想要跟踪贵国方案何时开设档案(而不是同一系统的其他档案),那么你就可以安装自己的安全主管,执行<编码>checkRead()的一套方法,这应当给你一个了解何时可以查阅。

import java.io.*;

public class Demo {
  public static void main(String args[]) throws Exception {
    System.setSecurityManager(new Sniffer());
    File f = new File("/tmp/file");
    new FileInputStream(f);
  }
}
class Sniffer extends SecurityManager {
  public void checkRead(String name) {
    System.out.println("Opening " + name);
  }
}




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签