Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"File not found" #14

Open
broakenmedia opened this issue Dec 16, 2015 · 0 comments
Open

"File not found" #14

broakenmedia opened this issue Dec 16, 2015 · 0 comments

Comments

@broakenmedia
Copy link

 fmt.Println("Current path:", curpath)
   var innerfiles []string
       if innerfiles, err = ftp.List(""); err != nil {
          panic(err)
  }

returns:
Current path: /40610
[Size=501214;Modify=20151215133602.000;Type=file; 40610_3286561_68607792_cmp.xml.gz
Size=49742;Modify=20151215133602.000;Type=file; 40610_3286561_68607792_cmp_delta.xml.gz
Size=49742;Modify=20151215133602.000;Type=file; 40610_3286561_68607792_cmp_deltatemplate.txt.gz
Size=501214;Modify=20151215133602.000;Type=file; 40610_3286561_68607792_cmp_template.txt.gz
Size=42;Modify=20151215133602.000;Type=file; 40610_category_list.txt
]

filename := strings.TrimSpace(strings.Split(innerfiles[0], ";")[3])

== 40610_3286561_68607792_cmp.xml.gz

var file *os.File
if file, err = os.Open(curpath + "/" + filename); err != nil {
    panic(err)
}

panic: open /40610/40610_3286561_68607792_cmp.xml.gz: no such file or directory

despite listing all the correct files, accessing the correct directory and the file existing, i am told it cannot open a non existent file? What's happening here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant