Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Lua 访问Corona SDK中的内部存储特定文件夹_Lua_Coronasdk_Internal Storage - Fatal编程技术网

Lua 访问Corona SDK中的内部存储特定文件夹

Lua 访问Corona SDK中的内部存储特定文件夹,lua,coronasdk,internal-storage,Lua,Coronasdk,Internal Storage,我知道这会读取保存在应用程序文档目录中的文件: filePath = system.pathForFile( "text.txt", system.DocumentsDirectory ) 我需要从另一个文件夹而不是我的应用程序中读取文件,例如,任何移动设备的“internal storage/download”文件夹下的文件夹,任何人都可以在上面的代码行而不是system.Documents目录中输入什么,下面的代码工作正常。然而,SD卡实际上意味着应用程序中的内部存储。另外,中间两

我知道这会读取保存在应用程序文档目录中的文件:

    filePath = system.pathForFile( "text.txt", system.DocumentsDirectory )

我需要从另一个文件夹而不是我的应用程序中读取文件,例如,任何移动设备的“internal storage/download”文件夹下的文件夹,任何人都可以在上面的代码行而不是
system.Documents目录中输入什么,下面的代码工作正常。然而,SD卡实际上意味着应用程序中的内部存储。另外,中间两行是代码工作所必需的,即使第四行直接指第一行

    filePath = "/sdcard/coordinates.txt"
    local file = io.open( filePath, "r" )
    local contents = file:read( "*a" )
      for line in io.lines(filePath) do  
        ii=ii+1
        points[ii] = line
        b1 = points[ii]
         c2 = 1
         for i in string.gmatch(b1, "%S+") do
            b={}
            b[c2]=i
            if c2 ==1 then bore[ii] = b[c2] end
            if c2 ==2 then x[ii] = b[c2] end
            if c2 ==3 then y[ii] = b[c2] end
            c2=c2+1
end

当时,使用Corona SDK API是不可能的。