AW: Samba and newline characters.
Chris Watt
cnww at chebucto.ns.ca
Thu Apr 13 22:21:29 GMT 2000
At 06:44 AM 4/14/00 +1000, Peter Samuelson wrote:
>The only suggestion on this that I've ever heard that I think would
>make any sense at all would be a per-share option to turn this behavior
>on and off. That way, if you know you are sharing a particular
Oddly enough, I'd always thought this was a silly idea and nobody in
his/her right mind would do it (that is not the odd part), but earlier
today (we're coming to the odd part now) I actually met somebody who DID
solve this problem. He has since decided to switch to my approach (use a
Windows based text editor that understands UNIX style newlines) but the
system he was using appears to be quite effective, provided that you don't
have very much concurrent random access (it has a race condition built into
it). What he did is maintain two seperate directory trees (of source code
in this case), one with DOS style newlines and one with UNIX style, and
have a script running in the background that would check every few seconds
to see if there were any differences in the two trees (modification time
that is), and if it found any it would pass the more recent version of a
file through a dos2unix/unix2dos filter to translate the line endings, and
overight the older version. Since he was basically editing only in Windows
and compiling in UNIX this worked perfectly, had he also been editing in
UNIX he might have had problems. . . AFAIK this should work perfectly as
long as one of the trees is essentially read-only, and since any reasonably
clever OS which is not memory starved will cache the modification time
information if it is being read every few seconds, the script doesn't even
generate much disc I/O. Sorry I don't have a copy of the actual script, but
it's neither long nor complex, I'm sure you can reproduce it fairly quickly
if you like. A more "safe" version would of course test whether a file is
ASCII text before translating it. . .
--
The difference between genius and stupidity is that genius has its limits.
More information about the samba
mailing list