file not found error

Hi there,

New here. Trying out the engine. I want to use a csv library (GitHub - FourierTransformer/ftcsv: a fast csv library written in pure Lua). According to the docs (Solar2D Documentation — Tutorials | Basics), if my module is the same as my main.lua, it should work. I put ftcsv.lua and a test.csv file in my main folder. Here’s my code:

local ftcsv = require(‘ftcsv’)
local stuff, headers = ftcsv.parse(“test.csv”, “,”)
print(headers)

Here’s the error: “C:\Users\John\Dropbox\Solar2d\BalloonTap\ftcsv.lua:375: ftcsv: File not found at test.csv”

It looks like the require(‘ftcsv’) line worked, but the second line didn’t. Is there a place I need to put my files? I don’t see any tutorials on adding files to your project except the modules one I list up above. What am I missing?

John

While the built-in Solar2D API will find files like that, Lua file system (lfs) and other external modules will require a more direct path, which you can get using:

That function will return the actual path for the file on the system, which is probably what your module is expecting.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.