Error handling for FSUtil.Exists

This script checks if the ftp server on my Android phone is running:

function OnClick(clickData)
{
    var path  = DOpus.FSUtil.Resolve("@Nexus6P//storage/emulated");
    if (DOpus.FSUtil.Exists(path))
    {
        DOpus.Output(path + " is alive");
    }
    else
    {
        DOpus.Output(path + " is NOT alive");
    }
}

If the server is up, feedback is fast, but if it is not, it takes a while and in addition to the DOpus.Output() I get the "official" error message:

Is there a way to have a shorter timeout for DOpus.FSUtil.Exists and to suppress the error message?

P.S.: The forum found my old question to be similiar to this one. Good job, forum!

1 Like

I'm a little surprised FSUtil.Exists works with FTP paths at all. It's only really intended for checking normal Windows paths.

Oooh! I didn't know this can be done! This is really useful!