原来的代码不能正常编译运行,我做了多处修改 应该是编译和运行环境不同造成的吧。我的环境是VC++2005 /* * cws2fws by Alex Beregszaszi <alex@fsn.hu> * Public domain. * * This utility converts compressed Macromedia Flash files to uncompressed ones. * */ /* * Modified by Wang Lu Feb. 6th, 2007 */ #include <sys/stat.h> #include <fcntl.h> //#include <unistd.h> //WL: no this header file in VC++ 2005 #include "zlib.h" #ifdef DEBUG #define dbgprintf printf #else #define dbgprintf #endif #define NULL ((void*)0) //WL: Dummy main(int argc, char *argv[]) { int fd_in, fd_out, comp_len, uncomp_len, tag, i, last_out; char buf_in[1024], buf_out[65536]; z_stream zstream; struct stat statbuf; if (argc < 3) { printf("Usage: %s <infile.swf> <outfile.swf>\n", argv[0]); exit(1); } fd_in = open(argv[1], O_RDONLY|O_BINARY); //WL: there wasn't O_BINARY originally, and didn't work correctly under VC++ if (fd_in < 0) { perror(...