FSOpenFork, FSCloseFork "DEPRECATED"… what else ? lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- Gilles · 2018-06-07 06:58 How do i hate this recurrent word at Apple : "DEPRECATED" !!! (ouuhh le vilain mot) Bref Since these deprecated functions (FSOpenFork, FSCloseFork and so on) don't work correctly since Sytem 10.13 (a -54 error often occurs when files are shared) probably because of the new APFS Since the Functions of the unit System from Free Pascal are not enough What solutions do you think are the best (and sustainable) ? ---------------------------------------------------------------------- Phil · 2018-06-07 13:02 Quote from: Gilles on June 07, 2018, 08:58:38 amSince these deprecated functions (FSOpenFork, FSCloseFork and so on) don't work correctly since Sytem 10.13 (a -54 error often occurs when files are shared) probably because of the new APFS Actually, those functions were deprecated in 10.8. Why do you need them? Are you trying to read a resource fork? ---------------------------------------------------------------------- Gilles · 2018-06-07 17:37 No, data… for example, for FSOpenFork : I found : "FSOpenFork (page 590) Deprecated in OS X v10.8 Opens any fork of a file or directory for streaming access. (Deprecated. At the POSIX/BSD layer, use open(2) OS X Developer Tools Manual Page and flock instead. To open a data fork at the Foundation layer, use NSFileHandle APIs instead.)" but that doesn't help… that's how I used it : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i xErr := FSOpenFork(xx_ref, xx_ULL.ull_hfs_dfn.length, @xx_ULL.ull_hfs_dfn.unicode, x_prm, x_rfn) It worked well and still work well but on HFS+ On the new format, there are problems if many users try to access the same file ---------------------------------------------------------------------- Gilles · 2018-06-18 17:25 Well, the error -54 seemed to have been a bug of the system and is supposed to be solved in macOS X 10.13.5 still deprecated but always supported ---------------------------------------------------------------------- ASBzone · 2018-06-18 20:48 Quote from: Gilles on June 07, 2018, 07:37:38 pmbut that doesn't help… What does that mean?  What is the error message? Quote from: Gilles on June 07, 2018, 07:37:38 pmOn the new format, there are problems if many users try to access the same file Error message? ---------------------------------------------------------------------- Gilles · 2018-06-19 05:31 when many users wanted to open a file already opened and closed by another user (in a local AFP network), it often generated a -54 error. Not always but often. The only possibility being restarting the server. Probably because the closed state of the file was badly transmitted. And that since 10.13 when server disk was formated in APFS. ---------------------------------------------------------------------- Gilles · 2018-06-26 14:50 well I maybe found the truc : ioRefNum used to be declared as SInt16 and used to be positive ioRefNum is now declared as FSIORefNum which is SInt16 if not CPU_64 and SInt32 if CPU_64 thus : if SInt16 (not CPU_64) is the declaration, it may be negative isn't that nice ?