|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- m% @) G F) S3 E0 W
- T5 a0 `4 E+ j1 T
在进行相关文件和文件路径判断时候,ufun提供了内置的方法。
- k& k9 H1 @, g' g/ qUC4560 通过设置第二个 参数为 100 可以判断文件夹,通过设置 为 0 可以查找文件。* ~9 u4 A4 k; K% A. }0 A
J. s3 G- ?5 c- a% H% Y* E) g
$ @- |6 m: P8 c k0 ^3 d! u
+ N- P0 G, P( E: G) }( @7 U0 R
1 Q1 C$ h2 T$ J. guc4560 (view source)3 ~; u. I9 T8 w5 E8 @$ u
% ^4 l; @1 i: v3 l- ?- Z4 @( M
Defined in: uf_cfi.h) m3 h3 u8 ?5 d/ C* ]/ G6 Q
/ [/ A4 V ^+ b
, k9 e. e$ s1 P4 N6 X4 Z0 Q
Overview) b1 [# P! F2 i6 h. [
0 u& b# p# U' M
Checks whether the specified file of the given type exists.
. M1 H: \2 H9 S1 m2 W4 U; f( l4 ^0 h- A/ i0 @4 x% W3 c
NOTE: Mixed or upper case file names may not be found if the
K/ s# b, M$ q9 genvironment variable UGII_OPTION = LOWER is set.9 f1 F& ^4 u- e. T
+ H# g5 V% o! \6 N' q& I# UPassing an ftype of 0 will look for a file but does not work for a directory.8 O$ N: v- i0 O2 e
To check for a directory the ftype must be set to 100.
3 _2 Z% S9 ?+ q) N; {$ x1 c9 x6 K9 _- ?4 p$ W- h( S; n
/ k+ P* p* P) r# u7 D7 J
Return
7 H! R4 y4 j% p7 [" D3 `) m% O, p/ }" q6 Z& F Z: u; q: a
Return code:
Z* ~ n3 z* ]8 W' ?' R( y9 ~< 0 = Error
6 W3 S! z" A' d* I% q= 0 = File Exists
1 t' {' R6 T0 p5 h2 _3 }* o( B5 G= 1 = File Does Not Exist$ I" V" `% S8 |' G, \; `- E) b
8 Q. J# Y& `* O
4 H R; E# t, j! p, k8 NEnvironment
8 X( b% O9 H( Z( R9 G6 A
9 r# C* l% T0 K- ] U$ T2 o" z" KInternal and External
# {& i+ {# ?9 w1 t6 f& a, _6 N" H
. D( k5 Y0 i# XSee Also
7 S6 q2 l. r6 }5 I B9 o1 A
: @4 o$ e2 b. ^5 lFor description of file types see table& X2 e! C. l9 N+ M' g/ |7 B) l
4 C2 |2 c# n6 n+ E% T
) m- ]4 k; p$ F8 ?7 ^1 S# |Required License(s)
0 m; s9 h# k }& ?# E0 d% I2 j. l# r
gateway
; K5 {7 b, U9 d. t) ?( Y4 J, f& o# F. N! z
3 ] }) M% `! T, \0 n0 ^' Q
3 U/ E! b& w& C: }9 x, |
int uc4560
6 T6 k$ X% ^% B- F# d( o) P1 S(* X7 I- b* s, E. g+ Z* u
const char * fspec,
$ a1 w* L% p4 K' gint ftype
( Q, K0 x' d7 R4 Y: n2 Y
, O, B$ q* j1 N/ W* P)
" a, E* ]4 q9 ~/ D) s) ^5 ~/ s- e* X1 F. ?
| const char * | fspec | Input | File to check | | int | ftype | Input | File type! C# U8 G/ \5 w
0 will check for files
4 t& b# R$ w9 _2 N+ l100 will check for directories | r, x( [7 m) s& }' [
$ o( z8 d) m) Y$ U
( @6 g9 I3 K& d( N/ I查找文件也可以通过UF_CFI_ask_file_exist
; w" J0 O$ b9 e; k
8 `3 N# v. q/ h& O7 T/ UUF_CFI_ask_file_exist (view source)' |6 ?+ x9 w* \) G
W7 e! p4 C' Y/ y- b/ N) c+ J( y
Defined in: uf_cfi.h
d- I0 K- f9 c& I0 Q8 H0 L
, h, k- e6 {6 x! Z ^. @" Z, A1 H6 b, S
Overview) m: t. J+ o/ K- I: o! t& R$ e
: q! i& H7 V" f0 ~% o4 ~
Test if a file exists.
: H) I$ x. o+ U V Y. N. e( v# `2 I$ t2 D
Note: This function only works with files - not directories. To check if a) V0 b& Z0 V- M- B. W- h7 E/ ^# K
directory exists use uc4560 and pass a file type of 100.* E4 ?5 K2 W! K; W" R. y$ q
' E& M, V! n9 i
6 `& W7 Z6 S6 l/ R/ PReturn4 C4 ?+ n( h: M* U) U; q& U+ B
! q+ b8 \, D$ u* j: d5 m0 - No error
3 \6 Q- n V7 w2 V4 b5 [Otherwise - Error Code l! A% x& S! H* v. l
$ ^% C$ x/ ^) Y+ {
2 A; u% Z( Q# H# [! f8 n2 mEnvironment
; `" v9 h+ K: m) p9 C. A! I" H- w1 c! l7 f/ }$ p K
Internal and External
* M B j1 |5 @
5 m4 d$ ^: z2 c B& a* O+ ]6 l- d+ U* m+ q. ]9 Z% d
History
7 b3 z! @! z7 c1 b0 O6 h- Z6 S! ]1 @- u9 U5 h
Originally released in V16.0
/ g3 F+ ?- F, C+ N: s' u: u* ^/ Y X. O. E% u- T6 r
: X2 l5 U7 }, s4 Q/ P3 p# ?Required License(s)! x, W7 ~: N+ y p- W" s
7 `7 R+ n7 f+ I
gateway
0 a5 E( G0 B/ [7 _3 Y. T0 q6 ~5 _* E B- a; M" v/ J* R# w
+ k9 K, r& J( d/ y
! Z0 U2 N, r+ o
int UF_CFI_ask_file_exist
$ ~$ l( E# s* B! t0 K0 O(
& Y# B6 G% T' N, S ]# g: Y6 Kconst char * file_spec,
/ J9 k6 o$ f. G$ gint * status
1 B z# h$ M8 m @* U- e7 i8 S# E
)
9 ^, C: m! m. ^- p0 P' b: P
# U) j6 g; }! J9 [3 j* G| const char * | file_spec | Input | The file to check | | int * | status | Output | File existence status.
( Q3 @+ A" q' K8 m. @, a0 k0 - file exists m1 y8 `1 W: l7 l5 M; o. A" O* A W
1 - file does not exist: x6 g7 `: S# Y1 |
G$ H/ I/ a' H; q u | % V6 ]2 W' E* K, o
|
|