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

ModeType() doesnt show permissions and modes on macos #62

Open
vireshwali opened this issue Apr 14, 2021 · 0 comments
Open

ModeType() doesnt show permissions and modes on macos #62

vireshwali opened this issue Apr 14, 2021 · 0 comments

Comments

@vireshwali
Copy link

go version: go version go1.16.3 darwin/amd64
godirwalk version: github.com/karrick/godirwalk v1.16.1
code used:

godirwalk.Walk(startingDir, &godirwalk.Options{
	Callback: func(osPathname string, de *godirwalk.Dirent) error {
		fmt.Printf("%s %s\n", de.ModeType(), osPathname)
		return nil
	},
	Unsorted:            true,
	FollowSymbolicLinks: false,
})

Observed Output:

d--------- /Library/Caches
---------- /Library/Caches/.DS_Store
d--------- /Library/Caches/ColorSync
---------- /Library/Caches/ColorSync/com.apple.colorsync.devices
d--------- /Library/Caches/com.apple.cloudkit
---------- /Library/Caches/com.apple.cloudkit/com.apple.cloudkit.launchservices.hostnames.plist
d--------- /Library/Caches/com.apple.iconservices.store

Expected Output: based on filewalker and os.FileInfo.Mode()

dtrwxrwxrwx /Library/Caches
-rw-r--r-- /Library/Caches/.DS_Store
drwxr-xr-x /Library/Caches/ColorSync
-rw-r--r-- /Library/Caches/ColorSync/com.apple.colorsync.devices
drwxr-xr-x /Library/Caches/com.apple.cloudkit
-rw-r--r-- /Library/Caches/com.apple.cloudkit/com.apple.cloudkit.launchservices.hostnames.plist
drwx--x--x /Library/Caches/com.apple.iconservices.store

Possible cause:
Walk.go line 244. ModeType is & with os.ModeType

Is this intentional?

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