开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜