Compute expected remote file mode from tempfile