mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-15 18:30:27 -04:00
fixed directory creation not checking capacity limit
This commit is contained in:
parent
5f0f5d79ff
commit
69048a92c4
@ -27,12 +27,16 @@ trait Capacity extends OutputStreamFileSystem {
|
|||||||
else false
|
else false
|
||||||
}
|
}
|
||||||
|
|
||||||
override def makeDirectory(path: String) =
|
override def makeDirectory(path: String) = {
|
||||||
|
if (capacity - used < Config.fileCost) {
|
||||||
|
throw new io.IOException("not enough space")
|
||||||
|
}
|
||||||
if (super.makeDirectory(path)) {
|
if (super.makeDirectory(path)) {
|
||||||
used += Config.fileCost
|
used += Config.fileCost
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
else false
|
else false
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user