Graham
21560b1afd
Ignore fsync on directory failures
...
It isn't supported on some platforms, so there's not much we can do if
it does fail.
Signed-off-by: Graham <gpe@openrs2.org>
2 years ago
Graham
f7e194dfa6
Improve atomicWrite
...
We fsync the temp file before doing the atomic move, which I think is
necessary if the underlying filesystem re-orders the operations (e.g. if
the atomic move is performed before the writes to the temp file have
been flushed to disk).
Similarly we fsync the parent dir before returning. For a single atomic
write in isolation this probably isn't important, but probably is useful
if a sequence of atomic writes is performed in order.
Signed-off-by: Graham <gpe@openrs2.org>
2 years ago
Graham
5cbaf55dd6
Add hash function used by pre-JS5 caches
...
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
65194fae43
Rename poll to removeFirstOrNull
...
This is more consistent with the Kotlin standard library.
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
2b9f423e9a
Remove unused Iterable extensions
...
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
49e5781288
Add addAll and clear methods to UniqueQueue
...
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
81e665e9d8
Add UniqueQueue
...
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
1954f408e7
Replace deprecated capitalize() function
...
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
b37e4d0d0b
Use alternatives for most methods deprecated in Kotlin 1.5
...
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
22c1b8a183
Use useTempFile extension method in atomicWrite
...
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
0b43e26d36
Remove redundant toList() calls after sorted()
...
Signed-off-by: Graham <gpe@openrs2.org>
3 years ago
Graham
f143eef142
Move Kotlin files from src/{main,test}/java to src/{main,test}/kotlin
...
Signed-off-by: Graham <gpe@openrs2.org>
4 years ago