AIX 7.2 TL3, Go version 1.14.2:
# oslevel -s7200-03-02-1846# rpm -qa | grep golanggolang-1.14.2-1.ppcgolang-src-1.14.2-1.noarchgolang-bin-1.14.2-1.ppcVery simple example with os.OpenFile() and Sync():
package mainimport ( "fmt" "os")func main() { f, err := os.OpenFile("/tmp/1", os.O_RDONLY, 0644) if err != nil { fmt.Printf("os.OpenFile: %s\n", err) return } defer f.Close() err = f.Sync() if err != nil { fmt.Printf("os.Sync(): %s\n", err) pe, ok := err.(*os.PathError) if ok { fmt.Printf("Op: %s, Path: %s, Err: %v\n", pe.Op, pe.Path, pe.Err) } else { fmt.Printf("not ok to PathError\n") } }}No Problems on Linux and Mac OS X, but on AIX:
os.Sync(): sync /tmp/1: bad file numberOp: sync, Path: /tmp/1, Err: bad file numberI think, sync() is quite usual function and should work ;-)
------------------------------
Andrey Klyachkin
------------------------------
#AIXOpenSource