Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: (OT) Fixing Line Endings

by Ovid (Cardinal)
on Nov 30, 2006 at 15:26 UTC ( #586965=note: print w/ replies, xml ) Need Help??


in reply to Re^2: (OT) Fixing Line Endings
in thread (OT) Fixing Line Endings

Well, it works in that it's something which could be automated and then, theoretically, doesn't require extra work on our part once it's installed. However, as one coworker has pointed out, we'd be altering customer files. If they FTP something to our server they could see the MD5 checksum fail, notice the file size is different, FTP it back to their box and get failures on their end, and so on. I think a hook which merely sends a warning message to the customer might be a better way to go.

Cheers,
Ovid

New address of my CGI Course.


Comment on Re^3: (OT) Fixing Line Endings
Re^4: (OT) Fixing Line Endings
by Melly (Hermit) on Nov 30, 2006 at 15:37 UTC

    You've got customers dumb enough to upload text files as binary, but smart enough to know or care what an MD5 checksum is?

    Humanity is doomed...

    Tom Melly, pm@tomandlu.co.uk

      That was only one example of a potential pitfall. As mentioned, automatically altering customer files could cause plenty of other problems. Further, I could easily see myself checking an MD5 sum but forgetting to FTP as text and then wondering what the problem is :)

      Cheers,
      Ovid

      New address of my CGI Course.

Re^4: (OT) Fixing Line Endings
by cLive ;-) (Parson) on Nov 30, 2006 at 16:49 UTC

    Then don't alter the files, just add a check like this as an upload hook:

    $file_content =~ m|^#!(/usr/[\w\/]*)\s*\r\n|s and -e $1 and `ln -s $1 $1\\r`;

    (untested). Then only the link gets created on upload, and the original file is untouched.

    We use pure FTP now after having big problems with ProFTPd (I forget what they were now). It's login/upload hooks are easy to use, and the overhead is pretty trivial.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://586965]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2014-10-31 23:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (225 votes), past polls