예제 #1
0
  /**
   * Flush all changed structures to the device.
   *
   * @throws IOException
   */
  public void flush() throws IOException {

    final BlockDeviceAPI api = getApi();

    if (bs.isDirty()) {
      bs.write(api);
    }

    for (FatFile f : files.values()) {
      f.flush();
    }

    if (fat.isDirty()) {
      for (int i = 0; i < bs.getNrFats(); i++) {
        fat.write(api, FatUtils.getFatOffset(bs, i));
      }
    }

    if (rootDir.isDirty()) {
      rootDir.flush();
    }
  }
예제 #2
0
파일: FatFile.java 프로젝트: NanoGame/jnode
 /**
  * Flush any changes in this file to persistent storage
  *
  * @throws IOException
  */
 public void flush() throws IOException {
   if (dir != null) {
     dir.flush();
   }
 }