In one of my projects I am populating the FS via files that the user 
drag&drops on the page. I am using FS_createPath and then FS_createDataFile 
to create respective FS entries from the user supplied files.

Unfortunately it seems that older and more recent Emscripten versions 
behave differently in this context - which sucks.

Specifically I am performing the  FS_createDataFile in a try/catch to 
handle the scenario where a user repeatedly drops the same file, i.e. that 
file then already exists.

The older Emscripten version reacted to this scenario with err.message == 
'File exists'
(it seems that the also supplied err.code unfortunartely was unusable 
garbage - which sucks). Though the check for a specific "message" - rather 
than some stable error code - seemed rather braindead, it at least allowed 
to properly handle the specific error scanario.

Unfornately it seems that the more recent Emscripten versions here have 
been made even worse: Now the err.message in this partucular scenario is "FS 
error" - which is a totally useless information and no longer allows to 
properly handle the specific error scenario.

I wonder what the "officially suggested" approach for this scanario might 
actually be - since the available exception handling obvisouly isn't fit 
for the task. (Since I don't want to support different implementations for 
use with different Emscripten versions, I am looking for a robost approach 
that actually works regardless of the used Emscripten version.)




-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/44ab15a9-90cd-4520-8fda-e6e7592ce214n%40googlegroups.com.

Reply via email to