ioutil.ReadDir error

62 views
Skip to first unread message

rob

unread,
Jul 19, 2019, 6:54:47 AM7/19/19
to golang-nuts
I have this in my code

  files, err := ioutil.ReadDir(CleanDirName)

  if err != nil {

    log.Println(err)

  }

Occasionally I have a symlink to another computer that goes stale, with
this error:

  lstat [symlinkname] stale NFS file handle

When this happens, ReadDir does not return any other files in the
slice.  I would like it to.  Is there any way for me to get it to do that?

--rob solomon

Steven Hartland

unread,
Jul 19, 2019, 7:12:33 AM7/19/19
to r...@drrob1.com, golang-nuts
If you want this behavior you'll need to use the lower level methods in the os package.

    Regards
    Steve
Reply all
Reply to author
Forward
0 new messages