system.pathForFile no longer works?

Maybe I missed something in the release notes, but it doesn’t seem to work anymore - at least in the simulator. Not a problem for image loads, as you can pass a second parameter specifying base directory, but the spritesheet load call doesn’t support this.

A simple test:

 local path = system.pathForFile("image.jpg", system.TemporaryDirectory)  
  
 print("path", path) -- path is good, file is there  
  
 local im = display.newImage(path)  
  
 print("im", im) -- nil  
  
 local im2 = display.newImage("image.jpg", system.TemporaryDirectory)  
  
 print("im2", im2) -- OK, but won't work for spritesheet load  

Any confirmation that this call is deprecated? Or that I’m just confused? All I really need to do is load a spritesheet from either Documents or Temp directory, not the default resource directory (which is not writeable in a valid app). [import]uid: 3953 topic_id: 6287 reply_id: 306287[/import]

I’m having similar issues. I’m using LuaSockets to download from FTP but the files are going to the root of my home directory on my mac rather than the app.

Found: system.pathForFile

This isn’t working for me either, based on the above code
local path = system.pathForFile(“image.jpg”, system.TemporaryDirectory)
print(“path”, path)

path is nil

Please advise. [import]uid: 31718 topic_id: 6287 reply_id: 23919[/import]

This is the required format now:

local im2 = display.newImage(“image.jpg”, system.TemporaryDirectory)

You can use the same for sprite sheets. It was omitted from the docs but they’ve now been updated. [import]uid: 3953 topic_id: 6287 reply_id: 24092[/import]

Any ideas why the following isn’t working (getting error “failed to find image”) - and the image is in the tmp directory

file is a string: “image1.png”

for num images…
path = system.pathForFile(file, system.TemporaryDirectory )
table.insert( imageTable, path )

myMovie = movieclip.newAnim( imageTable ) myGroup:insert( myMovie )

If I print out a value from the table it looks correct

/Users/JJ/Library/Application Support/Corona Simulator/NewApp-3322RA1108CE793E20A1B2E1EA8F1401/tmp/image1.png

I’m stumped…pls help. [import]uid: 31718 topic_id: 6287 reply_id: 24181[/import]