Using NT registry calls to solve CR-LF issue with text files.

Gunnar Degnbol degnbol at
Mon Feb 7 01:44:02 GMT 2000

At 11:13 07-02-00 +1100, Matthias Wächter wrote:
>On Mon, 7 Feb 2000, John E. Malmberg wrote:
> > Windows actually uses two methods of determining a file type.  The first is
> > a registry, and the second is to examine the first two bytes of the 
> file for
> > a signature.  Some programs use the signature over the file type.
>Isn't there a third variant? Having WinZip installed, some .EXE files are
>in fact self-extracting .ZIP files and thus have the "Open with WinZip"
>and "Extract to..." entries in their context menues in the Explorer. I
>think this works with the Explorer Shell Extensions - intelligent filter
>programs able to analyze the contents of a file.
>Maybe we write some interface to something like "Samba Shell Extensions"
>..? Intelligent filters for special file types deciding by themselves how
>to transmit/receive data for these files. F.e. one could write a filter in
>a way that all .txt files will be stored with Unix-like CR/LF -> LF
>translation and presented to Samba clients with LF -> CR/LF translation.
>Just a thought.

Take a look at  It is a shell extension doing 
some of the things discussed here, but with a different purpose. It 
identifies Linux executables on Samba shares and runs them (when 
doubleclicked) through X windows, via rsh/rlogin. I think I have got it 
working now.

I don't think automatic conversion of line feeds can work well. But it 
could be made easier to do manually by adding an item to the context menu 
to do the conversion in-place, after copying. But that can be done with a 
separate program and some registry editing.

It might be possible to add a property sheet to files on Samba shares with 
the Unix file attributes/owner. It would require some way to communicate 
the attributes, preferably within the SMB session. Perhaps squatting an 
unused information level somewhere ?


More information about the samba-technical mailing list