Size gets the length of the file.
(name string)
| 122 | |
| 123 | // Size gets the length of the file. |
| 124 | func (c *fileCache) Size(name string) (int64, bool) { |
| 125 | key := filepath.Join(name, "metainfo") |
| 126 | // c.metadataCache.Wait() |
| 127 | val, found := c.metadataCache.Get(key) |
| 128 | if !found { |
| 129 | return 0, false |
| 130 | } |
| 131 | return val.(int64), true |
| 132 | } |
| 133 | |
| 134 | // PutSize puts the length of the file. |
| 135 | func (c *fileCache) PutSize(name string, len int64) bool { |