Results 1 to 2 of 2

Thread: Adding extra control charcters in an uncompressed file.

  1. #1
    Junior Member
    Join Date
    May 2007
    Answers
    1

    Adding extra control charcters in an uncompressed file.

    I am creating a GZip file in linux by a java program. After Unzipped(by using gunzip command) the file in linux i am getting the file with the correct data. I ftped the file from Linux to Unix in binary mode. After unzipped(by using gunzip command) the file in Unix i am not getting the file with correct data. The control character(^M) is adding at every end of line. I am not able to find why its happening. Anyone can help me ?

    Plz..........

    Thanks


  2. #2
    Junior Member
    Join Date
    Mar 2007
    Answers
    10

    Re: Adding extra control charcters in an uncompressed file.

    This is a common problem with unix. Generally most of the operating systems add line feed and carriage return at end of each line. But Unix adds only line feed. Already zipped file in linux has line feed and carriage return at end of the lines. Unix unable to recognize carriage return character. So, it added ^M character at end of the each line.

    You can solve this by transfer the file using ascii mode instead of binary mode.

    I think in ur code u used " FullFtpClient.binary(); " for ftping in binary mode.
    Use " FullFtpClient.ascii(); " instead.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact