Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私の主な目的は、約 10 台の Linux システムが接続される Linux システムでサーバーを実行することです。したがって、私の動機は、サーバーに接続されている任意のシステムのディスク容量を見つけるために、サーバーを (Java で) プログラムすることです。これは可能ですか?? ubuntu 11.10でnetbeansを使用しています
前もって感謝します
はい、これは可能です。ソケットを使用してサーバーとクライアントシステム間の通信を作成でき、クライアントソケットはサーバーソケットにディスク容量を書き込むことができます。
システムのディスク容量を取得するには、ルートファイルの合計容量を取得します。
long diskCapacity = new File("/").getTotalSpace();