Roxen.git/
server/
modules/
filesystems/
filesystem.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2005-07-19
2005-07-19 12:17:04 by Henrik Grubbström (Grubba) <grubba@grubba.org>
756d3c489a24fce1de6afb1ba2de7a798c653603 (
14
lines) (+
13
/-
1
)
[
Show
|
Annotate
]
Branch:
5.2
Added cachecallback.
Rev: server/modules/filesystems/filesystem.pike:1.148
7:
inherit "module"; inherit "socket";
-
constant cvs_version= "$Id: filesystem.pike,v 1.
147
2004
/
06
/
30
16
:
58
:
59
mast
Exp $";
+
constant cvs_version= "$Id: filesystem.pike,v 1.
148
2005
/
07
/
19
12
:
17
:
04
grubba
Exp $";
constant thread_safe=1; #include <module.h>
749:
return errno_to_status (err_code, 1, id); }
+
class CacheCallback(string f, int orig_size)
+
{
+
int(0..1) `()(RequestId id, mixed key)
+
{
+
return _file_size(f, id) == orig_size;
+
}
+
}
+
mixed find_file( string f, RequestID id ) { TRACE_ENTER("find_file(\""+f+"\")", 0);
868:
"by user"); }
+
// Add a cache callback.
+
id->misc->_cachecallbacks += ({ CacheCallback(f, size) });
+
id->realfile = norm_f; TRACE_LEAVE(""); accesses++;