programing:linux-programing:file-splitpath-parse
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
programing:linux-programing:file-splitpath-parse [2020/07/01 10:21] – [概要] yoko | programing:linux-programing:file-splitpath-parse [2020/07/01 10:48] (現在) – [コンパイル実行] yoko | ||
---|---|---|---|
行 62: | 行 62: | ||
* @brief | * @brief | ||
* @author T.Yokobayashi de JR4QPV | * @author T.Yokobayashi de JR4QPV | ||
- | * @date 2020/06/28 | + | * @date 2020/07/01 |
*/ | */ | ||
行 84: | 行 84: | ||
| | ||
| | ||
- | | + | |
| | ||
| | ||
| | ||
* | * | ||
+ | * @note | ||
+ | | ||
* @attention | * @attention | ||
| | ||
行 115: | 行 117: | ||
if (dname[0] == '/' | if (dname[0] == '/' | ||
flg |= FLG_ABSPATH; | flg |= FLG_ABSPATH; | ||
+ | } | ||
+ | else if ((strcmp(dname, | ||
+ | /* dirname要素あり */ | ||
+ | n = strlen(dname); | ||
+ | bname = & | ||
+ | flg |= FLG_DIRNAME; | ||
} | } | ||
行 180: | 行 188: | ||
int flg; | int flg; | ||
| | ||
+ | if (argc > 1) | ||
+ | inpath = argv[1]; | ||
+ | |||
flg = _parsepath(inpath, | flg = _parsepath(inpath, | ||
if (flg & FLG_DIRNAME) { /* dirname要素あり ? */ | if (flg & FLG_DIRNAME) { /* dirname要素あり ? */ | ||
行 211: | 行 222: | ||
$ ./sample | $ ./sample | ||
dir=/ | dir=/ | ||
+ | |||
+ | $ ./sample / | ||
+ | dir=/aaa/, base=bbb.ccc | ||
</ | </ | ||
+ | |||
+ | * カレントディレクトリのプログラムファイルを実行するには、「./ | ||
+ | |||
programing/linux-programing/file-splitpath-parse.1593566508.txt.gz · 最終更新: 2020/07/01 10:21 by yoko