Temporary FolderItems - Recovered Items in Trash

  1. 7 weeks ago

    Michael D

    Jul 6 Pre-Release Testers, Xojo Pro

    One of my macOS clients is reporting that if they run my app then reboot, upon rebooting they are left with files in the Recovered Items in the Trash folder. This is under 10.11 and 10.12.

    I believe what's happening is related to this: https://forum.xojo.com/conversation/post/130210

    Although it may be normal behavior I'm wondering what best practices are now, especially given that Sierra now has the Optimize Storage feature (About this Mac / Storage / Manage...)

    I'd like to make sure my temporary folder items never end up in Recovered Items. But I'd also like the OS to be able to clean them up automatically if necessary.

    Is there a location that meets both needs?

  2. Christian S

    Jul 6 Pre-Release Testers, Xojo Pro Europe (Germany)

    You could try items in /tmp or in special folders.temporary.parent

  3. Michael D

    Jul 6 Pre-Release Testers, Xojo Pro

    Looking into it further, I think it may be the files that Xojo uses for Mutex objects? That wouldn't be something I can control necessarily.

  4. 5 weeks ago

    Michael D

    Jul 17 Pre-Release Testers, Xojo Pro
    Edited 5 weeks ago by Michael D

    This seems to be a widespread problem. Can anyone else confirm?

    Please test this:

    Upon restart, look in your Trash folder. You will see a Recovered Files folder and inside it will be zero-byte files which are named the same as the Mutex objects.

    This behavior is being seen with a variety of Xojo versions (from 2014R2.1 thru 2017.x).

    I have a customer complaining about this and wanting a refund, so (for me) it's a serious issue and I'd like to understand the problem and fix it if possible.

  5. Christian S

    Jul 17 Pre-Release Testers, Xojo Pro Europe (Germany)

    You could move to use temporary folder's parent folder for this instead.
    Or your own folder in ~/Library/Cache folder.

  6. Michael D

    Jul 17 Pre-Release Testers, Xojo Pro

    @ChristianSchmitz You could move to use temporary folder's parent folder for this instead.
    Or your own folder in ~/Library/Cache folder.

    Setting the path isn't possible with http://docs.xojo.com/index.php/Mutex Mutex objects, is it?

  7. Thomas E

    Jul 17 Pre-Release Testers

    and ist it really a good idea to fight against the OS?
    At least the temp-folder is cleaned up by the OS so that there are no left over files. Using another folder would fill up the disk…

  8. 4 weeks ago

    Beatrix W

    Jul 24 Pre-Release Testers Europe (Germany)

    Were you able to solve this issue? Got a user complaining about this, too.

  9. Jeff T

    Jul 24 Midlands of England, Europe
    Edited 4 weeks ago by Jeff T

    I have a customer complaining about this and wanting a refund

    Thats the second best excuse I have heard .

    The first being

    'even though I went to your website, tried the demo, bought the software with my Paypal account, downloaded it, installed it 2 months ago and registered it from my own IP address with my own email address -
    this was a fraudulent sale'.

    Im curious: in what way did this inconvenience the customer?

    And could you look in the trash folder for files that match your naming pattern, and delete them on startup?

  10. Emile S

    Jul 24 Europe (France, Strasbourg)

    Warning: Tomorrow customers will ask a module to build a story after giving the software a bunch of words (less than 10) and selecting a “domain” (say Police Story, Romance, Science Fiction and so on…) ?

    When will customers start to ask for an ESP module ?

    Sometimes I am at short (the reading let me with no idea, nothing to say, that is why I do not chime in on Jul 6.)

  11. Beatrix W

    Jul 24 Pre-Release Testers Europe (Germany)

    Let's not discuss about customers. They concentrate on simple things. Some are more detail orientated than others. If there is a simple way to fix this issue I'd like to do it.

  12. Greg O

    Jul 24 Xojo Inc Somewhere near Raleigh, NC

    There is. Instead of just creating, using temporary folderitems and letting them go out of scope, create a new class which contains a temporary folderitem which will automatically delete the file(s) for you when the class' destructor fires.

  13. Beatrix W

    Jul 24 Pre-Release Testers Europe (Germany)

    I'll try that. Hmm... that must be the file for the Valentina diagnosis I do after adding data.

  14. Michael D

    Jul 24 Pre-Release Testers, Xojo Pro

    @Greg OLone There is. Instead of just creating, using temporary folderitems and letting them go out of scope, create a new class which contains a temporary folderitem which will automatically delete the file(s) for you when the class' destructor fires.

    Greg, the problem seems to come from Mutex objects, which do not provide any options for where the temp file is located.

  15. Emile S

    Jul 24 Europe (France, Strasbourg)

    Recovered Items ?
    I have data there each time I fire Xojo and watch the Language Reference.

    Howecer, isn’t SpecialFolder.Temporary holds these files i a folder (called Recovered Items) ?

    If so, I would add code in Cancel Quit (or Quit) Event that scan that folder and if it find a folder called Recovered Items, open it, clears it and delete it (at last).

    Isn’t it possible to do that ?

  16. Michael D

    Jul 24 Pre-Release Testers, Xojo Pro

    @Emile S Recovered Items ?
    If so, I would add code in Cancel Quit (or Quit) Event that scan that folder and if it find a folder called Recovered Items, open it, clears it and delete it (at last).

    Isn’t it possible to do that ?

    I believe that leftover items in the Temp folder are moved to the Trash/Recovered Items folder upon reboot, so that your Xojo app would never have a chance to do that, unless your Xojo app runs automatically upon login (which mine does not).

  17. Emile S

    Jul 24 Europe (France, Strasbourg)
    Edited 4 weeks ago by Emile S

    @Michael:

    The folder may be stored elsewhere in the hidden OS files.

    I’ve made a search including System Files + visibles but I do not found one, before reboot.

    Time to sleep now.

    Edit: finish a sentence and add the last one.

  18. Greg O

    Jul 25 Xojo Inc Somewhere near Raleigh, NC

    @Michael D Greg, the problem seems to come from Mutex objects, which do not provide any options for where the temp file is located.

    I'm curious why the mutex file isn't being destroyed when you call Mutex.Leave as your app quits. We use a mutex for Feedback and it doesn't suffer from this problem.

  19. Tanner L

    is not verified Jul 25 Pre-Release Testers, Xojo Pro Toronto, Canada

    @Greg OLone I'm curious why the mutex file isn't being destroyed when you call Mutex.Leave as your app quits. We use a mutex for Feedback and it doesn't suffer from this problem.

    I don't know if it's a mutex causing this, but Feedback is leaving a temporary file behind. I just opened Feedback 2017r1.2, then closed it and logged out. Upon logging back in my .Trash directory contained a 0 byte file named "Xojo Feedback" in a dir named "Recovered files".

    Here's info on that file:
    $ ls -l@ -rw-r--r--@ 1 user staff 0 Jul 25 06:55 Xojo Feedback com.apple.FinderInfo 32

    This is on OSX 10.11.6.

  20. Kem T

    Jul 25 Pre-Release Testers, Xojo Pro New York

    I just did a quick test. Entering a Mutex does indeed create a file in Temporary, and Leaving it deletes it. Quitting without explicitly calling Leave deletes it too, but perhaps if it's located somewhere where its Destructor doesn't necessarily fire, it won't.

    If it's the Mutex at all, perhaps explicitly call Leave in the App Destructor? Or do what I do, create a wrapper class that holds the Mutex (or a Semaphore or CriticalSection) that calls Leave in it's Destructor. I use it like this:

    dim m as new Mutex( "MyApp" )
    dim holder as CSHolder = CSHolder.TryEnter( m )
    if holder is nil then
      // Couldn't get it
    else
      // Some code
      holder.Leave // Not strictly necessary as its Destructor will Leave it
    end if

    If your code exits early from, say, an exception or early return, the Mutex should still be unset.

  21. Newer ›

or Sign Up to reply!