mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-14 09:46:53 -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
|
||||
}
|
||||
|
||||
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)) {
|
||||
used += Config.fileCost
|
||||
true
|
||||
}
|
||||
else false
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user