Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error after repeatedly reading a file

Replies are disabled for this topic. Start a new one or visit our Help Center.

After reading a file from "application/private/data" multiple times an error gets thrown displaying "No available fd slots". The file's contents is read sequentially with the use of an array buffer.

This works a few times (around 5 or so) until it throws the error upon trying to call fs.opensync()

 

If anyone knows what causes this error or how to avoid it that would be great! 

 

An abbreviated version of the code:

 

var fileDesc = fileSystem.openSync( PENDING_FILE_NAME , 'r' ); 
var LengthToRead = 70;
var buffer = new ArrayBuffer(LengthToRead);
fileSystem.readSync( fileDesc , buffer , 0 , LengthToRead , 0 );
...
fileSystem.closeSync(fileDesc)

Could you also please confirm whether or not files stored in "/private/data" are permanent or if there is somewhere else they should be saved.

 

 

 

Many thanks 

 

Adam

 

 

 

 

Best Answer
0 Votes
1 REPLY 1

Sorry to clarify, I was asking if anyone knew what could be the cause of this error and had any solutions to avoid it. Thanks 🙂

Best Answer
0 Votes