Operation not permitted when trying to create a TFileStream Object on iOS8

∥☆過路亽.° 提交于 2019-12-12 04:36:38

问题


I am converting a Delphi windows app to be multi platform, a crucial part of the application is to be able to export some data files from an SQLite database to the host machine.
It works absolutely fine on windows and OSX, but when I deploy it to an iPad I get an error message stating :

Cannot create file "/var/mobile/Containers/Bundle/Application/9FFD6B02-1B3A-4F07-XXXXXXXXXXXXXXXXXX/AAG_Multi.app/Text/Templates/full Transcript.dwt   
Operation not permitted

I tried TMemorystream as well, same result. The directory should exist as I called Tdirectory.Creatdirectory(fullPath) immediately prior to the TStreamCreate Line.


回答1:


You are not allowed to write to the application bundle.

You need to write to a directory that is writeable. For instance, TPath.GetHomePath would return a directory to which you could write. Exactly what directory you should use, probably only you can decide.



来源:https://stackoverflow.com/questions/26467536/operation-not-permitted-when-trying-to-create-a-tfilestream-object-on-ios8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!