Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

What's the logic behind naming cached files? #441

Open
@buesing

Description

@buesing

please provide the version of installed library and RN project.

^0.10.5, React Native 0.45.1

I downloaded some files with fileCache: truebut without a path parameter. I found that in my tests, these files were saved in the DocumentDir in directories RNFetchBlob_tmp on iOS and RNFetchBlobTmp in Android. Is this dependent on the OS version or something else? Is the function I use below to clear all old cached files correct?

export function clearOldCachedFiles (files) {
  const isOldCache = fileName => fileName.startsWith('RNFetchBlob_tmp') || fileName.startsWith('RNFetchBlobTmp')
  return Promise.all(files.filter(isOldCache).map(fileName => {
    return RNFetchBlob.fs.unlink(`${directories.DocumentDir}/${fileName}`)
  }))
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions