                                 cb()
                 else
                     dbg("never edited before")
-                    if exists
+                    if locals.exists
                         dbg("path exists, so load from disk")
                         @_load_from_disk(cb)
                     else
                         cb()
             (cb) =>
-                if exists
-                    @_update_if_file_is_read_only(cb)
+                if locals.exists
+                    @_file_is_read_only (err, is_read_only) ->
+                        locals.is_read_only = is_read_only
+                        cb(err)
                 else
                     cb()
         ], (err) =>
-            @_set_initialized(err, cb)
+            @_set_initialized(err, locals.is_read_only, cb)
         )
 
     _patch_table_query: (cutoff) =>

                    cb : cb
        ], (err)=>cb?(err))

    _update_if_file_is_read_only: (cb) =>
        @_client.path_access
            path : @_path
            mode : 'w'
            cb   : (err) =>
                @_set_read_only(!!err)
                cb?()

    _load_from_disk_if_newer: (cb) =>
        tm     = @last_changed()
        dbg    = @_client.dbg("syncstring._load_from_disk_if_newer('#{@_path}')")
        exists = undefined
        async.series([
            (cb) =>
                dbg("check if path exists")
                @_client.path_exists
                    path : @_path
                    cb   : (err, _exists) =>
                        if err
                            cb(err)
                        else
                            exists = _exists
                            cb()
            (cb) =>
                if not exists
                    dbg("file does NOT exist")
                    @_set_read_only(false)
                    cb()
                    return
                if tm?

    # The project calls this once it has checked for the file on disk; this
    # way the frontend knows that the syncstring has been initialized in
    # the database, and also if there was an error doing the check.
    _set_initialized: (error, is_read_only, cb) =>
        init = {time: misc.server_time()}
        if error
            init.error = "error - #{JSON.stringify(error)}"  # must be a string!
