|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
UG NX二次开发:创建一个临时文件的函数uc45777 F! V" }( Y; v1 B5 g2 Y/ i w
非常ok的一个函数,特意放在这里,供大家使用,可以随机的创建一个临时的文件,如果代码里有每次不固定的字符串,可以使用这个函数哦!!
% w& j4 ]) \, T; k* F
; A+ L' n6 c/ W5 e- p. j! ODefined in: uf_cfi.h
- [9 e- R8 s/ d+ b. }1 ~- h& b / P8 ~6 t, ]3 c% O
9 x% S8 d6 \( [* `' v& ^) w5 E2 HOverview
6 _5 c A. e( {! ~0 I1 o+ ]( L8 M M
5 }; {+ S/ m e) v1 _) XThe name returned is a unique name for a temporary file. The resultant 3 k6 _% Z% o% U( G6 X% }$ Y3 z% Z2 z
filename is unique from other processes at the time. From a single
2 s0 \' I0 t# Z4 w# s' sprocess, filenames will begin duplicating after the first 1,679,615 calls ( r- g. R& l2 P3 D/ }7 P+ q8 d
to uc4577. Temporary files should be deleted when no longer needed by an 7 S$ m+ q% b0 Q
application. If the files are not deleted, there is a chance that the same : I0 W0 j; `; k+ T- c4 Y
name may come up again if the same user happens to get the same process id
- S1 V; q; v) e( a& D3 o, Jon a later date.
/ n) m" [$ k$ P1 U7 Y
! e. f1 B% g; X! v3 _The maximum number of characters which will be returned is 12.
' U1 c' N9 x; a2 F( b" r2 S4 x/ \+ E- U+ m3 v% X M$ n( O
' |! \& \/ A. R- S( \. tEnvironment# j! T1 }8 |1 ?2 n0 V2 g1 m+ }
$ E7 w, ~, P' ~; F9 ?
Internal and External
2 b" N# F: d7 W# [* U. I
; w9 k( v7 a; `: ^/ }5 P7 ^: Z) \* V' `" L% X* p* ^
Required License(s)
3 c* c6 k+ W" N) d: c9 B! U/ Z: I( Q0 ^' }1 G
gateway( d- i& d$ S9 o- ]6 n6 l
( I* X5 p4 t- }6 |
2 i5 E$ t" p" r# L. J
int uc45777 D' p, V! ?; ^8 z
(
: B# C. ~7 u' _. vchar fname [ UF_MAX_UNIQUE_FILE_NAME_BUFSIZE ]
4 X( E; K3 `" W2 O6 N
2 G, j8 h6 E; j" X)
6 q5 j7 o Z) O# M5 W
8 _8 e1 N" Y8 j3 ^9 b1 L5 w char | fname [ UF_MAX_UNIQUE_FILE_NAME_BUFSIZE ] | Output | Unique filename |
|
|