fixed my permissions error. Thanks!
On Tuesday, May 21, 2013 3:54:13 PM UTC+8, Jan Mercl wrote:
func isDir(pth string) (bool, error) {
fi, err := os.Stat(pth)
if err != nil {
return false, err
}
return fi.Mode.IsDir(), nil
}
-j
--On Tue, May 21, 2013 at 9:46 AM, Jon Renner wrote:
Can this be improved upon?
func isADirectory(path string) bool {
f, err := os.Open(path)
handleError(err)
stat, err := f.Stat()
handleError(err)
return stat.IsDir()
}
Not tested:Can this be improved upon?
func isADirectory(path string) bool {
f, err := os.Open(path)
handleError(err)
stat, err := f.Stat()
handleError(err)
return stat.IsDir()
}
func isDir(pth string) (bool, error) {
fi, err := os.Stat(pth)
if err != nil {
return false, err
}
return fi.Mode.IsDir(), nil
}
-j
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.