Clobber existing file with ar
When using ar with an archive name that already exists, this message is generated:
+ ar rcs /tmp/libcpfs.a.3nbsv /tmp/cpfs.c.ERGsn /tmp/log.c.1lk6G
ar: /tmp/libcpfs.a.3nbsv: File format not recognized
The existing archive name is either an empty file (created by mktemp).
I want to clobber whatever contents are there anyway, the contents of any existing file (be it an ar or not) don't interest me. How can I enforce this?
Update0
I'm currently using rm "$libcpfs_a" && ar rcs "${libcpfs_a}" ${libcpfs_objs[*]} as a work开发者_开发百科around.
Try forcibly removing the file before calling ar.
rm -f $file
ar rcs $file foo.c bar.c
加载中,请稍侯......
精彩评论