Manish Uskaikar wrote: > Hi All, > > I would like to "zip" a file using perl script. I used following command:- > > system ("zip <zip name> <file name>"); > > However this command fails when the filename is more than 8 characters.
Not true. I just tested, and filenames were not rejected for length. It does not ignore whitespace, though, and there doesn't seem to be any way to escape whitespace characters. > Since DOS does not support more than 8 characters. Wouldn't make any difference on Win2K. It doesn't use DOS for its command environment, although the interface does closely resemble DOS. It is a shell escaping issue. > Is there any way by which I can zip a file, whose name is 9+ characters long? I am > working on Windows 2000. Sure. Just do it. If your filename has spaces, you do have a problem. I like the suggestion of using a module, since you are doing it from Perl. No point in shelling out. For what its worth, the program itself doesn't have any problem even with spaces in filenames. I just zipped a directory with long filenames inside it, and they worked fine. Thanks for letting me know about this command-line tool. > Regards > > Manish U Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>