Last change
on this file since 398 was 392, checked in by alloc, 2 years ago |
Added command to invalidate file caches
Added a debug+profiling build target
|
File size:
506 bytes
|
Line | |
---|
1 | using System;
|
---|
2 | using System.IO;
|
---|
3 |
|
---|
4 | namespace AllocsFixes.FileCache {
|
---|
5 | // Not caching at all, simply reading from disk on each request
|
---|
6 | public class DirectAccess : AbstractCache {
|
---|
7 | public override byte[] GetFileContent (string _filename) {
|
---|
8 | try {
|
---|
9 | return File.Exists (_filename) ? File.ReadAllBytes (_filename) : null;
|
---|
10 | } catch (Exception e) {
|
---|
11 | Log.Out ("Error in DirectAccess.GetFileContent: " + e);
|
---|
12 | }
|
---|
13 |
|
---|
14 | return null;
|
---|
15 | }
|
---|
16 |
|
---|
17 | public override (int, int) Invalidate () {
|
---|
18 | return (0, 0);
|
---|
19 | }
|
---|
20 | }
|
---|
21 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.