This commit is contained in:
xushiwei
2024-05-14 19:19:46 +08:00
parent 6340ff7da0
commit 0c31300578
3 changed files with 1503 additions and 12 deletions

1448
py/os/gen.go Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -22,9 +22,21 @@ import (
"github.com/goplus/llgo/py"
)
const (
LLGoPackage = "py.os"
)
// https://docs.python.org/3/library/os.html
//go:linkname Getcwd py.getcwd
func Getcwd() *py.Object
// Rename the file or directory src to dst. If dst exists, the operation will
// fail with an OSError subclass in a number of cases:
//
// On Windows, if dst exists a FileExistsError is always raised. The operation
// may fail if src and dst are on different filesystems. Use shutil.move() to
// support moves to a different filesystem.
//
// On Unix, if src is a file and dst is a directory or vice-versa, an IsADirectoryError
// or a NotADirectoryError will be raised respectively. If both are directories and dst
// is empty, dst will be silently replaced. If dst is a non-empty directory, an OSError
// is raised. If both are files, dst will be replaced silently if the user has permission.
// The operation may fail on some Unix flavors if src and dst are on different filesystems.
// If successful, the renaming will be an atomic operation (this is a POSIX requirement).
//
//go:linkname Rename py.rename
func Rename(src, dst *py.Object) *py.Object