User documents directory problem

Home Forums General Programming User documents directory problem

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #68415
    dasfaker
    Keymaster
      • Topics: 80
      • Replies: 793
      • Total: 873
      • ★★★

      Hi
      My panels store data on files saved in the user documents directory. On Windows I have no problem, the files are created right. But I’m getting reports from two people having troubles on Mac, the files aren’t created, at least in this place.

      I’m using File.getSpecialLocation(File.userDocumentsDirectory) to access folder c:/Users//Documents. Is this the same on Mac? I don’t know if it’s a write protection issue or what. Can someone shed some light, please?

      Thanks.

      #68419
      dasfaker
      Keymaster
        • Topics: 80
        • Replies: 793
        • Total: 873
        • ★★★

        I’ve installed a VM with Mavericks, Ctrlr 5.3.122 and while I can create a directory, I can’t create a file. This is the code I’m using

        fileBankName = string.format("%s %s%s", "Bank", "A", ".nam")
        tempFolderFile = File.getSpecialLocation(File.userDocumentsDirectory):getChildFile("My Folder")
        if tempFolderFile:exists() == false then
             tempFolderFile:createDirectory()
        end
        tempBankFile = tempFolderFile:getChildFile(fileBankName)
        console(""..tempBankFile:getFullPathName())
        if tempBankFile:existsAsFile() == false then
            tempBankFile:create()
        end
        

        Is something wrong?

      Viewing 2 posts - 1 through 2 (of 2 total)
      • The forum ‘Programming’ is closed to new topics and replies.
      There is currently 0 users and 54 guests online
      No users are currently active
      Forum Statistics
      Threads: 2,495, Posts: 17,374, Members: 77,605
      Most users ever online was 12 on January 22, 2019 3:47 pm
      Ctrlr