#How to access file content of embedded file structure?

8 messages · Page 1 of 1 (latest)

copper dagger
#

if you embed files then the content would be in subdir files
so i'd be ./files/xxx instead of ./xxx

#

remove that part

#

and change WalkDir(filesFS, ".", saveFile) to WalkDir(filesFS, "files", saveFile)

#

dirname + "/" + d.Name() to filepath.Join(dirname, path)

#

it'd be better to share the code as text. i'm having a hard time, reading the code in the image.

#

that's better. i doubt my solution. i'm not sure if path already contain the files/ or not.
turns out it did.

#

where is it come from?
os.WriteFile or fileFS.ReadFile?

#

os.WriteFile would be relative to cwd. while fileFS.ReadFile would be relative to filesFS's root.