O_TRUNC will make fileentry.bytes.length = 0, but this throws a null pointer exception when fileentry.bytes is not set (which can be the case for ISpecialFile entries). Easily fixed:
if ( fileentry.bytes ) fileentry.bytes.length = 0
A real fix might call on ISpecialFile, which would require a new method such as truncate().
O_TRUNC
will makefileentry.bytes.length = 0
, but this throws a null pointer exception whenfileentry.bytes
is not set (which can be the case for ISpecialFile entries). Easily fixed:if ( fileentry.bytes ) fileentry.bytes.length = 0
A real fix might call on ISpecialFile, which would require a new method such as truncate().