User Tag List

Results 1 to 10 of 10

Thread: File Object, copy and move commands are broken on macOS?

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleMac Export ModuleInstall Creator ProPatch Maker
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2012
    Posts
    371
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    File Object, copy and move commands are broken on macOS?

    Hey @yves I may have found a missing feature of the file object on Mac. The exporter can create a folder, can write and read files but won't copy or move any file.

    Notice that in the example below, it will create a "data2" folder but won't perform the copy command.


    mac_wallp_test10_source.zip

    Thanks

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleSWF Export ModuleFirefly 3D Module
    tobydavis's Avatar
    Join Date
    Apr 2019
    Location
    United States
    Posts
    131
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SevenSails View Post
    Hey @yves I may have found a missing feature of the file object on Mac. The exporter can create a folder, can write and read files but won't copy or move any file.

    Notice that in the example below, it will create a "data2" folder but won't perform the copy command.


    mac_wallp_test10_source.zip

    Thanks
    Hi there SevenSails,

    This is not a bug, it's a quirk of how Mac applications work. On Macs, the application itself can act as an accessible directory. So, the Apppath$ variable on Mac actually points INSIDE of the application (mac_wallp_test.app), not to the directory that the executable is contained in. If you were to save data using something like the INI Object, right click your application, click "Show Package Contents", and navigate to "Contents/Resources/," you would see the INI file tucked right inside the application, or "package".

    This means to perform actions in the directory that your application is actually located in, and not the application itself, you will need to use ../ in your path names after the Apppath variable in order to exit out of the application's directory and in to the directory that the application is actually located in. Here's how that would be done:

    Apppath$ + "../data/wallp1.png"


    Also, your initial file copy action was written incorrectly, so it won't work on any platform. When you define the destination path, you also have to include the file name of the copied file in that path, which could just be the same name or something different:

    copy action.PNG


    Of course though, using ../ in your path on Windows machines will mess up the application, since the application itself cannot be its own directory on Windows. So, you will need to include different, runtime-specific events for your file operations. You can do this by cloning the events and adding an additional runtime check condition to them so that only one set will execute depending on the platform. You can find the condition that tests what runtime the application is running under by going to "Special --> Runtime --> Is running as.." in the New Condition menu.

    running as.jpg


    I've attached an updated example to this post. I hope all of this helps.

    mac_wallp_test_updated.zip

  3. #3
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleMac Export ModuleInstall Creator ProPatch Maker
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2012
    Posts
    371
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Thanks for you help, toby!
    You helped me out in Discord channel and I can confirm it's a bug on 294. In 293 it works fine.

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleSWF Export ModuleFirefly 3D Module
    tobydavis's Avatar
    Join Date
    Apr 2019
    Location
    United States
    Posts
    131
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    File Copying on Mac Broken on Build 294

    Quote Originally Posted by SevenSails View Post
    Thanks for you help, toby!
    You helped me out in Discord channel and I can confirm it's a bug on 294. In 293 it works fine.
    No problem! Just to clarify for the thread here, everything I outlined in my previous response works fine if Build 293.10 is used, but does not when Build 294 is used. Something related to file copying on Mac seems to have been broken at some point between Build 293.10 and Build 294.x (not sure which version specifically).

    Test Machines:
    Mid-2011 iMac (MacOS Sierra 10.12.6)
    Late 2014 Mac Mini (MacOS Monterey 12)

  5. #5
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    7,690
    Mentioned
    298 Post(s)
    Tagged
    4 Thread(s)
    I will check and let you know
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  6. #6
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleMac Export ModuleInstall Creator ProPatch Maker
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2012
    Posts
    371
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fernando View Post
    I will check and let you know
    thanks Fernando. I updated early today in Discord, it's probably my fault but even in build 293 I'm not getting File object to copy from a data folder no matter where the data folder is. I tried to reference data folder with either ../, ./ or just / it won't copy. No matter if data folder is in desktop as well, or anywhere inside the application folder. In one of the options it ask for permission but doesn't copy. Even if application folder and data folder are in desktop there is no way I'm getting the app to copy the file to documents/game folder. Only works if copy from documents to documents. Ideally it should copy that png from inside the app folder, not a data outside the app folder.

    mac_wallpaper_test14.zip

  7. #7
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    7,690
    Mentioned
    298 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by SevenSails View Post
    thanks Fernando. I updated early today in Discord, it's probably my fault but even in build 293 I'm not getting File object to copy from a data folder no matter where the data folder is. I tried to reference data folder with either ../, ./ or just / it won't copy. No matter if data folder is in desktop as well, or anywhere inside the application folder. In one of the options it ask for permission but doesn't copy. Even if application folder and data folder are in desktop there is no way I'm getting the app to copy the file to documents/game folder. Only works if copy from documents to documents. Ideally it should copy that png from inside the app folder, not a data outside the app folder.

    mac_wallpaper_test14.zip
    the change that is affecting this, is one made in 2017, I will add a fix and let you know in discord for you to try.

    =================================

    * Start of Frame
    + Is running as Mac application
    bk : Load Apppath$ + "data/wallp1.png" into Animation Stopped, Direction ............, Frame #0, HotSpot(100000,100000), Action Point(100000,100000), Transparent Color RGB(255,0,192)
    note that the path have being change since path are relative to the one used for embedded data as posted in data elements - binary data XXXXX\data\wall1.png


    Now in your example you are copying from data\ to data2, but data doesn't exist, is a mere reference for embedded file, for this let me see if I can add something

    * User clicks with left button on copy button
    + Is running as Mac application
    File : Create the directory Apppath$ + "data2"
    File : Copy Apppath$ + "data/wallp1.png" to Apppath$ + "data2/wallp1.png"

    Regards,


    Fernando Vivolo

    ... new things are coming ...

  8. #8
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    7,690
    Mentioned
    298 Post(s)
    Tagged
    4 Thread(s)
    OK, i made some changes in MAC runtime and the file object, please contact me in Discord to organize a small test.

    Now this

    * User clicks with left button on copy button
    + Is running as Mac application
    File : Create the directory Apppath$ + "data2"
    File : Copy "data/wallp1.png" to Apppath$ + "data2/wallp1.png"
    The new action copy, from file object, will check in embedded file system and make the copy accordingly (only copy action can do this, not the move or merge action)
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  9. #9
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleMac Export ModuleInstall Creator ProPatch Maker
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2012
    Posts
    371
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fernando View Post
    OK, i made some changes in MAC runtime and the file object, please contact me in Discord to organize a small test.

    Now this



    The new action copy, from file object, will check in embedded file system and make the copy accordingly (only copy action can do this, not the move or merge action)
    thanks DM sent in Discord.

  10. #10
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    7,690
    Mentioned
    298 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by SevenSails View Post
    thanks DM sent in Discord.
    please register first in the click converse channel
    Regards,


    Fernando Vivolo

    ... new things are coming ...

Similar Threads

  1. Android copy/Load image using file object
    By db251 in forum Android Export Module 2.5
    Replies: 85
    Last Post: 22nd December 2021, 09:56 PM
  2. I seem to have broken my "File" object...
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 5th July 2011, 04:33 PM
  3. file object won't copy? or create new directory?
    By Skeets in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 23rd June 2010, 10:37 PM
  4. The File Archive is Broken!
    By Jaffob in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 11th October 2008, 01:01 PM
  5. file object ... Does the copy action...
    By Gibbon in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 22nd April 2008, 09:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •