def writeEntry(bs)
      return if not @dirty
      cluster = @parentCluster; offset = @parentOffset
      buf = bs.getCluster(cluster)
      if @lfn_ents
        @lfn_ents.each {|ent|
          buf[offset...(offset + DIR_ENT_SIZE)] = BinaryStruct.encode(ent, DIR_ENT_LFN)
          offset += DIR_ENT_SIZE
          if offset >= bs.bytesPerCluster
            bs.putCluster(cluster, buf)
            cluster, buf = bs.getNextCluster(cluster)
            offset = 0
          end
        }
      end
      buf[offset...(offset + DIR_ENT_SIZE)] = BinaryStruct.encode(@dir_ent, DIR_ENT_SFN)
      bs.putCluster(cluster, buf)
      @dirty = false
    end
def writeEntry(bs)
      return if not @dirty
      cluster = @parentCluster; offset = @parentOffset
      buf = bs.getCluster(cluster)
      if @lfn_ents
        @lfn_ents.each {|ent|
          buf[offset...(offset + DIR_ENT_SIZE)] = BinaryStruct.encode(ent, DIR_ENT_LFN)
          offset += DIR_ENT_SIZE
          if offset >= bs.bytesPerCluster
            bs.putCluster(cluster, buf)
            cluster, buf = bs.getNextCluster(cluster)
            offset = 0
          end
        }
      end
      buf[offset...(offset + DIR_ENT_SIZE)] = BinaryStruct.encode(@dir_ent, DIR_ENT_SFN)
      bs.putCluster(cluster, buf)
      @dirty = false
    end
WRITE: write or rewrite directory entry.