Returns a new kind of Storage which maps the contents of the given filename to memory. Valid TYPE are Char, Short, Int, Long, Float, and Double.

The size of the returned Storage will be

(size of file in byte)/(size of TYPE).

Example:

$ echo "Hello World" > hello.txt
$ lua
Lua 5.1.3  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> require 'torch'
> x = torch.CharMapStorage('hello.txt')
> = x
  72
 101
 108
 108
 111
  32
  87
 111
 114
 108
 100
  10
[torch.CharMapStorage of size 12]

> = x:string()
Hello World

> x:fill(42)
> 
$ cat hello.txt 
************