Menu

Windows/Unix file format

Help
Anonymous
2003-12-03
2013-05-20
  • Anonymous

    Anonymous - 2003-12-03

    Is there a way to choose the export file format?  I'm running Eclipse with Epic in Windows but frequently export files to Unix systems.  As a consequence I have to run dos2unix after every export in order to remove those nasty Windows \m characters.  I can't find this option in Eclipse nor in the Epic settings.

    Can anyone point me in the right direction?

    Big Thanks,
    Steve

     
    • Jochen Ruehl

      Jochen Ruehl - 2003-12-03

      Hi Steve,

      you could use the Source Formatter to do this (which is perltidy).
      Normally perltidy uses the line separator of the host system, but you can also specify it. You could specify the -ole optin in the Source Formatter Preference page.

      Here is an extract of the perltidy man page:

      -ole=s, --output-line-ending=s

      where s=win, dos, unix, or mac. This flag tells perltidy to output line endings for a specific system. Normally, perltidy writes files with the line separator character of the host system. The win and dos flags have an identical result. NOTE: This only works under unix-like systems and is ignored under other systems.

      Hope that helps.

      Bye
      Jochen

       
      • kozitza

        kozitza - 2007-02-20

        Looks like from the perltidy man page that the --output-line-ending option only works on a unix type machine. So I guess that means if I edit on windows and run on unix I will still need to run dos2unix to make it work.

        I did try specifying the following on windows

        --output-line-ending=unix

        And it did not work still got the windows eol char.   Am I missing something am I stuck with this behavior? Is perltidy going to be updated to support it?

         
        • Kenny Raby

          Kenny Raby - 2007-09-20

          The inability to specify the EOL character when working under Windows is very annoying.  I have been using the PHP Development tools which do have this ability so have been looking all over the place for this option for EPIC just to find others are having the same issue with no solution other than running dos2unix.   I have been using SVN to check out the scripts and work on them on my laptop which is Windows (company supplied) then commit and check out on the server which is running Linux where they fail to work because of this. Are there any plans to fix it?

           
          • Manni

            Manni - 2007-09-21

            Why don't you let subversion handle this?

            See http://svnbook.red-bean.com/en/1.4/svn.advanced.props.file-portability.html for more information. This has the additional benefit that you can use other native Windows editors to work with your files without worrying about line endings (think Notepad).

            Manni

             
          • dark2phoenix

            dark2phoenix - 2007-09-26

            I believe you can set Eclipse to always create files in at least the UNIX file format. 

            see "Additional configuration steps for all Eclipse users" section at:
            http://ist.berkeley.edu/as/ag/tools/howto/install-eclipse-win.html

            I set my system up like that ages ago since I develop pretty much exclusively on Windows for LINUX systems.

            You still have to convert files that were created on Windows (I believe) but just FTP'ed them to my LINUX box, ran dos2unix, then re-imported them into Eclipse.

             
    • Ben Imp

      Ben Imp - 2003-12-04

      Are you speaking of the Export Source To HTML or the formatting of the source file itself?

       
    • Jochen Ruehl

      Jochen Ruehl - 2003-12-04

      Hi,

      I'm speaking of the Source Formatter (Ctrl+Alt+F).
      Haven't tried it myself, but according to the docs should work.

      Bye
      Jochen

       
      • Ben Imp

        Ben Imp - 2003-12-05

        Im thinking steve might be talking about the export to HTML ... not sure though.  I have eclipse running on my Redhat 9 box at home, ill give both a try and see which doesnt play nice with newlines.

        It kind of has to be the source formatter though, since html uses specific line break tags ... so I guess there goes my theory. :)

         
    • Kenny Raby

      Kenny Raby - 2007-09-20

      FYI I was looking at the perltidy change log and see this:

      2007 04 24
      -ole (--output-line-ending) and -ple (--preserve-line-endings) should
      now work on all systems rather than just unix systems. Thanks to Dan
      Tyrell.

      But it isn't working in EPIC still that I can tell and the help for perltidy options still has the note that it doesn't work.  Am I missing something?

       

Log in to post a comment.