Skip to content

[Feature iOS only] API to check whether a file is excluded from backup, and set or unset it when necessary  #55

Open

Description

@Yupeng-li

Hi there,

We have a scenario to toggle isExcludedFromBackup on iOS to exclude or include a file from/to backup. We think this can be a part of react-native-fs, so we added a patch locally to include these two functions.

export const isExcludedFromBackupIOS: (filepath: string)=> Promise<boolean>;
export const setIsExcludedFromBackupIOS: (filepath: string, isExcludedFromBackup: boolean)=> Promise<void>;

We'd like to submit a PR if you agree. Please let me know your thoughts.

Activity

  1. birdofpreyru commented on Jul 2, 2024

    @birdofpreyru
    Owner

    Good. A few thoughts out of my head:

    • Make it OS independent — isExcludedFromBackup() / setIsExcludedFromBackup().
    • We need to check if similar feature exists on Android / Windows. If yes, we need to support it (perhaps later), otherwise we should return some static results from these functions on Android / Windows that make sense for default behavior there.
    • Perhaps, setIsExcludedFromBackup() should resolve to boolean flag, true if OS supports that, false if not (so that it is possible to call it on any OS without error, but there is a way to check whether it actually has effect or not).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    On HoldBlocked for some reason.P2Important issue.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions