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

成都創(chuàng)新互聯(lián)公司是一家專注于做網(wǎng)站、網(wǎng)站建設(shè)與策劃設(shè)計(jì),屯留網(wǎng)站建設(shè)哪家好?成都創(chuàng)新互聯(lián)公司做網(wǎng)站,專注于網(wǎng)站建設(shè)10年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:屯留等地區(qū)。屯留做網(wǎng)站價格咨詢:028-86922220
- 說明:獲取當(dāng)前工作路徑。
- 格式:
func Pwd() string
- 示例:
func ExamplePwd() {
// Get absolute path of current working directory.
fmt.Println(gfile.Pwd())
// May Output:
// xxx/gf/os/gfile
}
Home
- 說明:獲取運(yùn)行用戶的主目錄
- 格式:
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
- 說明:獲取當(dāng)前運(yùn)行程序的絕對路徑。
- 格式:
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
}
網(wǎng)頁名稱:創(chuàng)新互聯(lián)GoFrame教程:GoFramegfile-常用目錄
轉(zhuǎn)載來源:http://fisionsoft.com.cn/article/djispsd.html


咨詢
建站咨詢
