新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)GoFrame教程:GoFramegfile-常用目錄
常用目錄
Pwd

成都創(chuàng)新互聯(lián)公司是一家專注于做網(wǎng)站、網(wǎng)站建設與策劃設計,屯留網(wǎng)站建設哪家好?成都創(chuàng)新互聯(lián)公司做網(wǎng)站,專注于網(wǎng)站建設10年,網(wǎng)設計領(lǐng)域的專業(yè)建站公司;建站業(yè)務涵蓋:屯留等地區(qū)。屯留做網(wǎng)站價格咨詢:028-86922220
- 說明:獲取當前工作路徑。
- 格式:
func Pwd() string
- 示例:
func ExamplePwd() {
// Get absolute path of current working directory.
fmt.Println(gfile.Pwd())
// May Output:
// xxx/gf/os/gfile
}
Home
- 說明:獲取運行用戶的主目錄
- 格式:
func Home(names ...string) (string, error)
- 示例:
func ExampleHome() {
// user's home directory
homePath, _ := gfile.Home()
fmt.Println(homePath)
// May Output:
// C:\Users\hailaz
}
TempDir
- 說明:獲取拼接系統(tǒng)臨時路徑后的絕對地址。
- 格式:
func TempDir(names ...string) string
- 示例:
func ExampleTempDir() {
// init
var (
fileName = "gfile_example_basic_dir"
)
// fetch an absolute representation of path.
path := gfile.TempDir(fileName)
fmt.Println(path)
// Output:
// /tmp/gfile_example_basic_dir
}
SelfPath
- 說明:獲取當前運行程序的絕對路徑。
- 格式:
func SelfPath() string
- 示例:
func ExampleSelfPath() {
// Get absolute file path of current running process
fmt.Println(gfile.SelfPath())
// May Output:
// xxx/___github_com_GOgf_gf_v2_os_gfile__ExampleSelfPath
}
分享名稱:創(chuàng)新互聯(lián)GoFrame教程:GoFramegfile-常用目錄
網(wǎng)址分享:http://www.dlmjj.cn/article/djispsd.html


咨詢
建站咨詢
