code: private File createAttachFile(int pid) throws IOException {
          String fn = ".attach_pid" + pid;
          String path = "/proc/" + pid + "/cwd/" + fn;
          File f = new File(path);
          try {
              f.createNewFile();
          } catch (IOException x) {
              f = new File(tmpdir, fn);
              f.createNewFile();
          }
          return f;
      }
docs: checks for the file.