Skip to content

Forbid paths in “Save as...” dialog box

On saving to file from the Web UI, one can input a path instead of a filename, which may fail... or not, if the parent path actually exists.

For example, if one opens a tracking data file in directory a/b and requests some labels to be saved as c/d.label, if directory a/b/c does not exist, LT.jl fails with message:

┌ Warning: error while processing received msg                                                                                                                                                                                                                
│   exception =                                                                                                                                                                                                                                               
│    SystemError: opening file "a/b/c/d.label": No such file or directory                                                                                                                                                                  
│    Stacktrace:                                                                                                                                                                                                                                              
│      [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)                                                                                                                                                                                           
│        @ Base ./error.jl:176                                                                                                                                                                                                                                
│      ...
└ @ Bonito ~/.julia/packages/Bonito/BbLUm/src/types.jl:25

An error is expected instead, including when directory a/b/c exists.