prg_env_user_home_get()

Abstract

Returns the path to the current user’s home directory.

Syntax

prg_env_user_home_get (home_dir_str)
Argument Type Description
home_dir_str char * A character array which will receive the user’s home directory.

Return Type

PrgT_Compcode

PrgC_Compcode_Failure if the user’s home directory could not be obtained from the operating system; PrgC_Compcode_Success otherwise.

prg_env.h

Example

char home_dir_str [128];
...
prg_env_user_home_get (home_dir_str);
printf ("The user's home directory is %s\n", home_dir_str);

Details

The path to the user’s home directory is obtained from the operating system (usually by fetching the value of the HOME environment variable or equivalent). Because the details vary from system to system, this function is provided as a convenience.

Purpose

The string returned by this function can be used to locate the user’s home directory for the purpose of saving user-specific data (configuration settings, etc.).

Errors

  • None

Reference

  • None

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com