{"id":5182,"date":"2014-03-30T19:30:27","date_gmt":"2014-03-30T19:30:27","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-to-check-if-a-file-is-open-by-another-process-java-linux-collection-of-common-programming-errors\/"},"modified":"2014-03-30T19:30:27","modified_gmt":"2014-03-30T19:30:27","slug":"how-to-check-if-a-file-is-open-by-another-process-java-linux-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-to-check-if-a-file-is-open-by-another-process-java-linux-collection-of-common-programming-errors\/","title":{"rendered":"How to check if a file is open by another process (Java\/Linux)?-Collection of common programming errors"},"content":{"rendered":"<p>You can run from Java program the <code>lsof<\/code> Unix utility that tells you which process is using a file, then analyse its output. To run a program from Java code, use, for example, <code>Runtime<\/code>, <code>Process<\/code>, <code>ProcessBuilder<\/code> classes. Note: your Java program won&#8217;t be portable in this case, contradicting the portability concept, so think twice whether you really need this \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can run from Java program the lsof Unix utility that tells you which process is using a file, then analyse its output. To run a program from Java code, use, for example, Runtime, Process, ProcessBuilder classes. Note: your Java program won&#8217;t be portable in this case, contradicting the portability concept, so think twice whether [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5182","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5182"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5182\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}