MacFileOperationStatusMBS Error Codes

Any idea why there’s a separator between -45 and -46? Both groups don’t look different.
(I’m asking because it’s a long time question I have, regarding how “.h” files are “structured”).

The file is 20+ years old and has been appended over the years.
So maybe the C compiler used to have a performance improvement if you group those in about 20 items?

You’re right. There are exactly 20 items in each group. Lucky they are that there are exactly 40 error codes in the list…
Knowing little about C, I’m wondering how a C compiler uses these “.h” files. I mostly use “.h” files as references (enumerations, available API names, etc.), but I’ve never known the relation with a compiler.

I seem to have fixed the problem.

By setting moviePlayer.movie = new movie, prior to effecting the macFileOperation.move, then the file is moved without code -47 being raised.

I had previously tried setting moviePlayer.movie = nil, but that still resulted in code -47 errors.

So I think the cause is probably the combination of three things:

  1. A delay in processing within certain magnetic drives.
  2. Movie.open(file), not creating a copy of the movie (as stated in the manual), but somehow retaining an instance of the file itself.
  3. MoviePlayer.movie = nil, not removing the reference to the file, whereas MoviePlayer.movie = new movie overwrites the reference.

The result being that MacFileOperation thinks that the file is still in use, and issues code -47.

There should be a way to set a movie to nil (or, at least, reset the player); for me, this is the main issue in your explanation.
Obviously, if setting a movie to nil doesn’t clear the MoviePlayer’s loaded movie, you can hardly delete the related file.

Setting the movie to a “new movie” is a workaround; it still uses the memory of an existing movie and is not clean.

I think you (or someone else) should fill a bug report (or feature request? Not sure).

Another possible workaround for now would be to close the MoviePlayer (e.g. put it inside a control array, even with a single control in the array, and close the player; I would expect the movie to be freed).

<https://xojo.com/issue/60958>

Nice, thank you.