system.ApplicationSupportDirectory bug, directory does not exist.

I could not read files using network.download into system.ApplicationSupportDirectory. When i downloaded the app container, found out that the path for directory did not exist. (Supposed to be inside Library) After adding 

lfs.mkdir(system.pathForFile("", system.ApplicationSupportDirectory))

Everything works out fine. I can now read/write files from/to the Application Support directory with no problem, download files and then use them. After re-downloading the container it now shows up. I guess this is a bug, or it could be added to the docs.

This only happens on iOS. tested on iOS 10.3.2, Corona 2017.3081. Does not happen on Android or the simulator for mac. Did not test on Windows.

You haven’t posted the code which did not work, but based on the fact that your working code does work and is in line with the documentation, what’s the problem? There certainly isn’t any bug illustrated in your post.

https://docs.coronalabs.com/api/library/system/ApplicationSupportDirectory.html

Try this in an iOS device and it will not print:

local path = system.pathForFile("something.txt", system.ApplicationSupportDirectory) local result, message = io.open(path, "w") if result then print("yay") end

This happens because the “Application support” folder is not automatically created. (which it should)

And of course my code works, i found a workaround, or a fix, however you wish to call it.

In fact, the code in the documentation does not read or write the file. 

You haven’t posted the code which did not work, but based on the fact that your working code does work and is in line with the documentation, what’s the problem? There certainly isn’t any bug illustrated in your post.

https://docs.coronalabs.com/api/library/system/ApplicationSupportDirectory.html

Try this in an iOS device and it will not print:

local path = system.pathForFile("something.txt", system.ApplicationSupportDirectory) local result, message = io.open(path, "w") if result then print("yay") end

This happens because the “Application support” folder is not automatically created. (which it should)

And of course my code works, i found a workaround, or a fix, however you wish to call it.

In fact, the code in the documentation does not read or write the file.