|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
: [- O1 i) R9 L4 x5 f
1 F8 E/ N/ v: U1 M' a7 s/ w' ^在进行相关文件和文件路径判断时候,ufun提供了内置的方法。
8 d) |8 _1 e& q4 f$ U! ?& P" uUC4560 通过设置第二个 参数为 100 可以判断文件夹,通过设置 为 0 可以查找文件。5 m) r2 v+ d2 `+ B; s
3 v7 t& z1 f8 B/ f
' _, P- l$ j: m+ R- P) B
: |+ T; S: _0 K+ J+ g
' ]- m2 W, C, M+ `; ruc4560 (view source)" }& c" ^# ~/ r. X7 ?
o3 Z0 Y! N7 [$ i! YDefined in: uf_cfi.h' d$ _) [) c+ ~# c3 B. F
. u# Z8 @9 F M+ v3 y# ]# P
6 X( S7 I/ k; A8 R6 Y! s* m& rOverview; Y. I ?- p) i2 n
( k K/ Z( d) R! C- i
Checks whether the specified file of the given type exists.( o8 B- ?& ]2 v5 M% \+ n
9 `8 B3 e$ Y& F6 G5 G
NOTE: Mixed or upper case file names may not be found if the) Y0 z1 p9 R. _; ]" A
environment variable UGII_OPTION = LOWER is set.
& e. W# r+ ^* P7 i/ G1 O/ O9 b) \
Passing an ftype of 0 will look for a file but does not work for a directory.' u! F, P, ~* `# H* p
To check for a directory the ftype must be set to 100.9 r4 M7 x- [" q5 q
# s: G5 H6 F7 L& w; V l- V m
" }9 u+ C# D" W0 J
Return
' Q+ Y; r6 A/ j( s. \& b G( p3 Z0 r) Q: ]! L/ g
Return code: n. @; b- q2 ~" Z) i; j% S0 j
< 0 = Error1 W8 M' {7 @' k3 J
= 0 = File Exists
) V' i# q) q5 X+ M8 q= 1 = File Does Not Exist
; z' Y6 @6 f. e7 T% _+ |
& q/ c$ E- _) _
4 c* L, L# n* [Environment
1 j6 [+ ~! A7 E0 Q9 `* f3 C
/ e4 L0 Q& q6 |Internal and External
% {3 ?6 L7 E; d' X2 K& q
# K6 U3 s0 j8 b' `/ a: N8 ^& v' J$ W: ~- W
See Also
; J) b% a+ |9 V" T$ a5 I$ a+ s. d$ s6 V' h7 l. B
For description of file types see table: a. n$ u# e* x) c* y# m
6 s- p& u& {+ D. N3 v. e. Q
& X1 r% m+ i4 N% A4 `6 o6 L5 O# Y, u
Required License(s)% v& j: S- K/ r# L# ?( V! t1 h) ]
0 Q, d6 S+ Q" l" x3 m
gateway
( {8 Q6 [2 }" k& O7 \6 F" o+ U+ `' L8 v* G- `
- r c7 {! Q7 ]! d% T
9 O2 q! h* D5 Eint uc4560
2 i. D+ @& l8 j3 `4 `% s1 h b" @' A(
8 h5 ]0 l& F% p. O& V0 Iconst char * fspec,# X0 Q$ y% f. ` P, q' W S7 w& r& V9 U
int ftype; [- h: E( `: i; Y5 G
) O1 s' }+ X- `$ A) y
)+ R7 U' f- c q3 y/ n
8 j& Q# H# |: [
const char * | fspec | Input | File to check | int | ftype | Input | File type
6 j3 E( H4 A, c+ H4 ?0 will check for files
- Y0 R: y* Z# m) u+ V# F100 will check for directories |
9 t% X: ^1 a5 y+ ]* G% I8 U! i
, p% [; v5 s$ C( F5 P: m: S
% Q! R/ h4 Y! \/ w! Q查找文件也可以通过UF_CFI_ask_file_exist# N3 ]0 ]( G3 v
/ F( R7 ]" J( v0 gUF_CFI_ask_file_exist (view source)
) f, c8 X5 Y s* V4 T
9 W: r0 e7 P# u; d4 NDefined in: uf_cfi.h. N N5 V2 a# `8 X2 B4 K
' {( m! R5 t" e/ o# k0 i
+ V# K3 V3 F, Q! X8 w. Q& B9 jOverview
$ G7 j7 T9 G; m! f) l
6 q# x8 C0 y7 k" E# ITest if a file exists.( N& S" X k, h1 l# A. Y; Q) t# K
6 y4 B9 w3 q$ t: A4 H& H+ nNote: This function only works with files - not directories. To check if a
9 n- D6 g* c, p& A* Y* ?directory exists use uc4560 and pass a file type of 100.2 d. C+ V3 M% u1 U. |. U
* R* t) ^. \' a8 h2 W% u% k! ~
6 Z0 d+ d' F$ s4 W7 }# cReturn0 @ |1 v" b5 s# g. z
$ K# \+ g' ^" H& x- ?
0 - No error
; G, f9 b+ V& F. u- S, W# _Otherwise - Error Code
3 `8 i$ S1 Z9 ^( j% e3 e( _ q, B+ q! B [( P {4 W
$ o& G6 [, j3 g$ F; m H W: r: mEnvironment
+ G& u; C( O* q* F# }5 R8 |5 k, P# |3 t& Z3 |. T
Internal and External
8 S W9 U" A: Y% e6 w0 i
1 N ?5 u& L# C! @+ O/ E
5 T: V( y4 j s5 L; E/ UHistory
3 e* i7 _$ o+ q/ E9 o, u& M. a4 b" V0 r& ~5 r0 g$ B
Originally released in V16.0
& R, Q5 {) j" P3 c7 O+ o- L- G . }3 v* u+ X6 N1 E; [4 @; k
& c3 u6 `5 L# k+ J8 I( qRequired License(s)' r( B* @/ o2 ]! k" \
) E3 k5 \1 S: O/ W; X2 J3 Fgateway
1 |3 ~0 Q( x, M2 e" _* q7 {; i- l) a
0 P K0 v! h* b+ {2 ^
# x' ]* B* h2 p
int UF_CFI_ask_file_exist: Q9 Q B, X5 ]
(
5 Y* c# c/ U# w$ t6 xconst char * file_spec,9 y) ^9 P2 h/ W* f3 v, _- N. @0 C9 e
int * status
8 H* h& U8 w( \
4 H$ B' H# \6 c5 n, D)+ s8 [" J2 u5 B3 r/ Z& T% p
6 \) {, n3 H# k* Q
const char * | file_spec | Input | The file to check | int * | status | Output | File existence status.
2 p$ w% Q* j. Y8 A- |0 - file exists
# R, a( J& N/ v) ~% A/ J: p1 - file does not exist
3 E$ p6 N [1 q7 M4 Q( I W. R0 p" J7 ^: s
|
8 e* L l% y: n, |- h8 u9 d) C0 y |
|