Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a shared over samba directory which i access from my windows development box. Problem is that when i create and edit files they are saved with dos linebreaks. Is there any way to configure samba to do automatic translation for all text files? Or perhaps files of certain type?

share|improve this question

3 Answers 3

up vote 5 down vote accepted

Here is the relevant section from the docs.

4.7. CR + LF

Unix text-file lines are terminated by 0A (LF)

MS text-file lines are terminated by 0D 0A (CR LF)

Samba does not do and will not do any conversion of these files at all. There are a number of conversion utilities on both platforms, these will have to be used.

Personally, I think it is easier to simply use a text editor on windows which allows you to set the line ending style.

share|improve this answer
    
+1 I would think that a file server should not do what the OP wants. It should only serve files. –  sybreon Oct 8 '09 at 0:22

Samba is a server and client for accessing SMB networks. It doesn't parse the contents of files. Your best solution is to use a text editor in Windows that produces files with UNIX linebreaks. Anything else will be a real kludge. I suggest Notepad++ for Windows. It should be available on Sourceforge.

share|improve this answer

Actually, samba can. For instance using the Samba File Extension Mapping VFS Module (google it)

Combine it with tofrodos or a similar program to convert crlf<>lf

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.