Created
July 15, 2015 18:42
-
-
Save jayjanssen/8ee0659dc0618ba60268 to your computer and use it in GitHub Desktop.
Can I read the gcache mmap?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "github.com/riobard/go-mmap" | |
import "fmt" | |
import "os" | |
func main() { | |
file, err := os.Open( "/gcache/galera.cache") | |
if err != nil { | |
panic( err ) | |
} | |
fmt.Println( "Opened") | |
gcache, err := mmap.Map( file, 4096, 50000000000, mmap.PROT_READ, mmap.MAP_SHARED ) | |
if err != nil { | |
panic( err ) | |
} | |
for i := 0; i < 4096; i++ { | |
fmt.Println( "str: ", string(gcache[i:(i+64)])) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment