|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
H7 }# U& C1 t2 k' q9 ?4 K: h+ m; E, H- A
在进行相关文件和文件路径判断时候,ufun提供了内置的方法。3 w7 m& w$ X) _" h; p
UC4560 通过设置第二个 参数为 100 可以判断文件夹,通过设置 为 0 可以查找文件。
m8 c1 p+ W! }8 Z& d& \3 z: f* q, q4 ?; n$ T4 M4 Z1 b& x$ l
$ |$ o9 v9 n5 ]' d; s4 C0 u& o- f; e
+ I* J. R3 Z: Z8 f
) J5 Q$ T M$ t3 [4 f- Q- c" ~. Huc4560 (view source)
+ z% X) w0 Y+ O2 G# ~
( R3 j% B$ m/ @# k* MDefined in: uf_cfi.h
9 V* B4 W8 q, k
- W4 s, @9 k. |( E# k! h2 Z7 r. a) x
H2 n# ]) q5 N4 k$ R, h6 |4 e1 [8 DOverview: l O* ~; `# L/ A
1 W6 a3 D) L, D9 c; z" ?* n5 v9 U
Checks whether the specified file of the given type exists.
( ?, o6 |8 O. @" {# N+ B1 A9 |3 F9 ^" _2 M+ n
NOTE: Mixed or upper case file names may not be found if the8 ~ D7 z: ^9 H5 V' {
environment variable UGII_OPTION = LOWER is set.
! }7 Q9 W- p' o8 }; x- [. K0 c# _
5 j& Z; }$ S& g9 H( jPassing an ftype of 0 will look for a file but does not work for a directory.
. _ n+ ?- C7 q. ~( P t1 vTo check for a directory the ftype must be set to 100.
& a4 i0 M: H9 R% Z4 K+ [2 o2 A: q# k( W. u
! h. s$ D' H! E" e/ C
Return5 [! x5 w7 C2 ?+ K! J2 A
2 n) n( r D/ J; @+ j5 f
Return code:
: u# a# J; r3 o4 K7 i1 B< 0 = Error1 K I3 T5 V" w- P; s0 Q4 w% u8 x
= 0 = File Exists
. N% `$ E8 h4 n3 S= 1 = File Does Not Exist
" b6 m: I& D) @/ l, W2 a2 f" s; q5 u q
7 z: w4 l. d' M& ?; q/ ?
Environment
& x: y0 x4 f# H" W! ]: s
* {! k' f! v0 yInternal and External
H8 o0 W4 X* j8 k# C8 u0 }
3 o( [' i5 S6 @3 Z) r" Y8 @! Z% }2 \" A" j
See Also
' o1 A% e8 w( {& \1 o, W9 z; a# z+ l0 c* |: c2 v. ~' ]/ u) R# ?
For description of file types see table
X4 P& P$ `. e
/ m' K+ u1 v- v9 a( T
& D) N$ r( o& f4 o0 ?, K$ o7 KRequired License(s)+ I) |) \0 v/ c" g
+ `% l% d1 r. x
gateway
2 I5 G# o, b# H: Z- X+ v/ H, L- d& L
5 n. D: i4 z8 [; r4 c; p+ y
2 K* Y4 [$ P( @6 a R. V1 t3 e
% Q. } s5 q( c" j, L+ qint uc45600 g$ Q- q5 Z v8 U
(9 H4 {) m" B* D8 e1 B4 b h) W) y
const char * fspec,
. P* @; \$ W1 {# S+ Y0 w. kint ftype
: Q+ ?. { n! T% R: J' d" Z; P$ W8 t6 d! o! q% s8 u7 S
)$ f9 R. }( f: G5 j# W4 v3 w7 p
4 _: W' ]& n! i+ a! u: {1 y
const char * | fspec | Input | File to check | int | ftype | Input | File type
2 K1 j! R/ s) ?$ t$ G' s0 W6 X0 d1 p0 will check for files
7 o( |7 \. G% {6 Z% f100 will check for directories |
2 ~/ U" |0 q# J( r) M6 w# G6 i+ @9 p7 {1 R$ c
- b% `) r3 p4 [* R
查找文件也可以通过UF_CFI_ask_file_exist( r; G' w* m2 s1 B4 {4 t6 w) C
4 |2 o* G0 J% z, ^5 sUF_CFI_ask_file_exist (view source)) I5 X, x1 @( g! l
' E" G5 {! O7 f
Defined in: uf_cfi.h# j6 n7 c7 T* R, _+ \1 c
1 \9 X1 `5 ?* ~( a6 `! T: q8 G; R
$ G8 n0 M7 _, {7 o2 m7 WOverview
2 F0 X& `% f, }/ d. H
8 u8 [' G+ J8 z, uTest if a file exists.
" c) I0 ^; E( {! _) i [/ q2 p5 u4 K$ x: E2 q( J
Note: This function only works with files - not directories. To check if a/ W! v: H* ?" Q- E' G# R, j' e
directory exists use uc4560 and pass a file type of 100.% `* x' Z1 n) a2 ]
7 b5 Y# ]- y! s) H/ `% U4 v& n
4 U% C) n# K& \! QReturn; s) ?3 l& e# V# i, O" ^
) K! |# i' P: Q: Y( @ B0 - No error
0 D- C8 t+ J+ n" k2 nOtherwise - Error Code
G6 N/ S2 y- x" J. N) u9 B9 K) L# d) x4 x
3 j. n2 A+ q9 w3 i, P1 b' n
Environment. g: J. A% M& }5 E/ U
1 |0 N% R7 z) p7 ^
Internal and External
! U4 |" c5 z5 F+ H0 L1 a6 A/ g i6 y5 @
" ~9 r3 m$ H3 U7 P6 l; k: z
History/ }1 {2 C- x) ~% m3 o
5 ~5 V! N5 w& o
Originally released in V16.0
5 P e/ O, L+ Q% B, a3 u' L. `
- E( T" P* x' X: Q! y4 b5 z! v+ b" y# M
Required License(s)
- H3 F0 ]% s3 @* r! h0 ^+ s) M
7 Y. c# `( _1 o9 g6 e& i) U: Cgateway
2 F/ f x9 B8 y" b* b( l; g& E2 p1 o o' X
0 P( m3 l2 r/ e3 o0 y& _
( _0 c: Z( j0 [* J& D9 u7 S& A) ]; uint UF_CFI_ask_file_exist5 D5 f* m+ [* Y4 t# D- n+ @2 M
(
/ S7 F Q0 O, W7 L; fconst char * file_spec,3 H* [( X0 ?$ @4 _6 U2 i
int * status# A7 G2 P$ b: V% W* B# a
+ t2 q" j- ^$ t& ?0 {9 u
)/ a! ^1 h+ S% A# w4 @, ~
) ]0 l9 d2 ?+ T3 [ z h/ ]" S, x8 Wconst char * | file_spec | Input | The file to check | int * | status | Output | File existence status.% a6 n- ]$ a6 S* _* v
0 - file exists" T5 a& V' K. _, N6 U, O
1 - file does not exist- c" \4 z) D% m) H3 u ~
. y6 n. _, G; E" M- c/ } |
3 X+ K# q; D5 e% J |
|