Forum

    • Register
    • Login
    • Search
    • Categories

    Copy File API

    General Questions
    3
    6
    50
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DanH
      DanH last edited by DanH

      Struggling with this.

      Here's the API

      File.copy(var target)
      

      Here's my code

      LicenseFile.copy(FileSystem.getFolder(FileSystem.AppData));
      

      No errors but not copied file either. Any ideas?

      d.healey 1 Reply Last reply Reply Quote 0
      • d.healey
        d.healey @DanH last edited by d.healey

        @DanH Are you sure that LicenseFile exists? I haven't checked but it could be that the target has to be a file not a directory:

        LicenseFile.copy(FileSystem.getFolder(FileSystem.AppData).getChildFile("MyLicense.txt"));

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        DanH 1 Reply Last reply Reply Quote 0
        • DanH
          DanH @d.healey last edited by

          @d-healey aha that was it, thanks!

          d.healey 1 Reply Last reply Reply Quote 0
          • d.healey
            d.healey @DanH last edited by

            @DanH said in Copy File API:

            @d-healey aha that was it, thanks!

            What was?

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            Christoph Hart DanH 2 Replies Last reply Reply Quote 0
            • Christoph Hart
              Christoph Hart @d.healey last edited by

              @d-healey If you copy a file somewhere you must ensure that the parent directory exists or the copy action will fail (because it will never implicitly create directories).

              1 Reply Last reply Reply Quote 1
              • DanH
                DanH @d.healey last edited by

                @d-healey it needed to be written / copied to a file, not a directory 🙂

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post

                6
                Online

                977
                Users

                6.6k
                Topics

                60.6k
                Posts