1

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?

3 Answers 3

5

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.

1
  • 1
    +1 I would think that a file server should not do what the OP wants. It should only serve files.
    – sybreon
    Oct 8, 2009 at 0:22
2

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.

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .