I am looking to swap contents of two files atomically on iOS. I came upon exchangedata() API here:
But on doing a quick test, it returns -1 with errno = EINVAL. Does iOS support this API (system call) ?
Thanks
I am looking to swap contents of two files atomically on iOS. I came upon exchangedata() API here:
But on doing a quick test, it returns -1 with errno = EINVAL. Does iOS support this API (system call) ?
Thanks
I'm surprised that this doesn't work on iOS. Have you tested similar code on OS X to make sure it's not a problem with your code?
However, even if you can get this working I recommend that you not.
exchangedata
is a historical anomaly and it's not a good idea to base new code on it. For example, if you ever ported that code to OS X you'd find that it only works on certain file systems (primarily HFS Plus and AFP), so you need a backup plan anyway. And once you have a backup plan, you might as well use it all the time (-:
Share and Enjoy
—
Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"