----- END PGP SIGNATURE -----I can only think of two methods to determine file size that are consistant withthe C standard:1) fopen() the file,initialize an unsigned long (or longer) variable to 0until fgetc() returns end of file, add 1 to the counterfclose() the file,or2) fopen() the filefseek() to the end of the fileftell() the position of the end of the filefclose() the fileBoth of these methods have their drawbacks. Character counting may givedifferent results depending on whether the file was opened in binary or textmode, and fseek()/ftell() may or may not work, depending on the implementation("a binary stream need not meaningfully support fseek calls with a whence valueof SEEK_END" and ftell() return value is either the absolute position (when usedon a binary stream), or some "unspecified information" when used on a text stream).Your choice.- --Lew PitcherIT Specialist, Enterprise Data Systems,Enterprise Technology Solutions, TD Bank Financial Group(Opinions expressed are my own, not my employers'')-----BEGIN PGP SIGNATURE-----Version: GnuPG v1.2.4 (MingW32)iD8DBQFC+1XaagVFX4UWr64RAhyzAKCYNfPqV64rRBZ5p6SoxZ oJxMvp5gCg7C80colQvhV5MvyjLy/zhrNDSgA==CstA-----END PGP SIGNATURE----- 这篇关于SIze的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-27 08:48