file_picker_writable icon indicating copy to clipboard operation
file_picker_writable copied to clipboard

[IOS] skipDestinationStartAccess warning

Open ahmtydn opened this issue 11 months ago • 0 comments

Warning: startAccessingSecurityScopedResource is false for file:///private/var/mobile/Containers/Shared/AppGroup/A33CEDC8-AC01-4799-B622-684C1CB35B11/File%20Provider%20Storage/data.xlsx (destination); skipDestinationStartAccess=true

Why am I getting the warning? And why are you abbreviating this filename? Can you remove the abbreviation in this filename and release a new version? I removed it manually but I don't want it to break in any pubscpec process.

  Future<T> _createFileInNewTempDirectory<T>(
      String baseName, Future<T> Function(File tempFile) callback) async {

-     if (baseName.length > 30) {
-       baseName = baseName.substring(0, 30);
-     }

    final tempDirBase = await getTemporaryDirectory();

    final tempDir = await tempDirBase.createTemp('file_picker_writable');
    await tempDir.create(recursive: true);
    final tempFile = File(path.join(
      tempDir.path,
      baseName,
    ));
    try {
      return await callback(tempFile);
    } finally {
      _unawaited(tempDir
          .delete(recursive: true)
          .catchError((dynamic error, StackTrace stackTrace) {
        _logger.warning('Error while deleting temp dir.', error, stackTrace);
      }));
    }
  }
}

ahmtydn avatar Jul 19 '23 15:07 ahmtydn