returning -1 if no file can be allocated
Authored by: ruckert 2015-09-15
Parent: [r525]
Child: [r527]