# File lib/cgikit/resource.rb, line 393
  def bytedata( name )
    data = nil
    if filepath = path(name) then
      if filepath =~ /#{File.expand_path(@tmpdir)}/ then
        cache = nil
        FileLock.shared_lock(filepath) do |file|
          cache = Marshal.load(file)
        end
        data = ByteData.new(cache[:data])
        data.path = filepath
        data.content_type = cache[:mime]
      else
        data = ByteData.new_with_file(filepath)
        data.content_type = content_type(filepath)
      end
    end
    data
  end