Displaying a picture from a LFS created sub folder in system.Documents... problems.

Has anyone used the LFS abilities to make sub folders in your System.DocumentsDirectory…

and then, try and use a display.newImage command to display a file from inside a sub directory you have created?

I am having problems getting it to find the file in the sub directory. if i put the file in the root of system.documentsDirectory… no problem. but if its in a folder, i keep getting a error from the display.newImage command saying it can’t find the file.

I use the file IO function to check and see if the file is found in the sub directory path… and it works and says FOund.

anyone have this issue or have a working example of this? [import]uid: 88147 topic_id: 26776 reply_id: 326776[/import]

Can you post up a small example of how you are trying to do this?

Thanks [import]uid: 84637 topic_id: 26776 reply_id: 108687[/import]

thanks for the reply, i just figured it out. the API documentation could be updated so it makes refrences to the addition of LFS…

here is what i was trying to do:
[lua]–this WORKED for a File IO call
local tempPath = system.pathForFile( “”, system.DocumentsDirectory )
local path = tempPath…tempSetName…string.char(92)
local filehandle, reason = io.open( path…dataRow[loop1].questiongraphic, “r” )
–the file was found with NO problem.
–so i tried the same thing with display.NewImage and it failed to find the file

temppic = display.newImage(gBackground1,picture,path,1,1)
–this Failed to find the file…

–so finally i got it to work by doing this:
temppic = display.newImage(gBackground1,deckInfo.deckset…string.char(92)…picture,system.DocumentsDirectory,1,1)
–basically i added the SUB folder i made to the front of the Picture name. and then just called the systems.DocumentsDirectory… directly.
–What messed me up is that it worked 1 way for File IO and for displaying a new Picture it worked differently.[/lua] [import]uid: 88147 topic_id: 26776 reply_id: 108698[/import]

I am having the exact same problem. Has this been resolved?? Thanks. [import]uid: 8780 topic_id: 26776 reply_id: 111410[/import]

Same here. It seems the baseDirectory parameter for display.newImageRect can only be one of the predefined ones like system.DocumentsDirectory. I would have thought the preferred way would be to use a path from system.pathForFile() as the baseDirectory but I haven’t been able to get that to work.

-- works, but seems like a hack to need hard-coded directory separator characters  
local temp = display.newImageRect( kDIRNAME.."/"..v.filename, system.DocumentsDirectory, v.width, v.height );  

[import]uid: 119931 topic_id: 26776 reply_id: 114688[/import]