Is there any option that will covert a text file from one system to the other? I have a few files on linux with extension TXT. There are plain text files. On NT, TXT is associated with the "notepad" and opens with the file as one long string. This is the typical CR/LF conversions between Unix and DOS. Can Samba convert the text files based on the client? Subba Rao subb3@attglobal.net http://pws.prserv.net/truemax/ => Time is relative. Here is a new way to look at time. <http://www.smcinnovations.com
At 12:56 PM 12/29/99 +1100, you wrote:>Can Samba convert the text files based on the client?No. This would be a very dangerous thing for Samba to try to do, especially when you consider the fact that a Linux newline is one character, and a DOS newline is a CR followed by an LF, so it would even be changing the size of the file from one client to another. . . Nasty business. In my case since I use a Windows workstation (I like the GUI, and I like being able to go play games from time to time) to write code for Linux and Solaris, I just installed a Windows text editor that could handle Linux/UNIX style line endings (in my case GWD Text Editor). If you absolutely cannot buy new software, just put the updated version of edit.exe on your Windows boxes (it comes with win9x, and probably also with NT4) and use that instead of Notepad. It doesn't have much in the way of features, but it can deal with line endings properly. If (for some reason) you absolutely MUST have the files translated to you can read them in notepad, get a copy of the dos2unix and unix2dos text conversion utils and then run them with the preexec and postexec commands in your share definition. It will be a little silly, and somewhat risky if it's a multi-user accessable share, but it would work. -- Who is this General Failure, and why is he reading my hard disk?
There's a cute little utility called 'unix2dos' that you should be able to find with any search engine, but, the solution is buried in your NT installation: Instead of opening these files with Notepad, open them with Wordpad. It works appropriately. Just dereference the .TXT files from Notepad and reference to Wordpad, and you'll not be bothered by this. -- Gerry Creager Mapping Sciences Laboratory 409.845.7201 Office Texas Agricultural Experiment Station 409.845.2273 Fax Texas A&M University System 409.228.7686 Pager (preferred) College Station, Texas 77843-2120 gerry@page4.tamu.edu Pager: 4092287686@mobile.att.net "Opinions expressed are mine and do not necessarily represent those of Texas A&M University."
Subba, Samba itself doesn't do translation, thank goodness. Your best solution depends on what you're doing with the translation. For instance, you might be building a website in-place to be displayed via http. In that case you'd need to remove the ^M chars and also get the capitalization of files to match their links. That's best done with a script that traverses the website tree. The script would have as its heart something like this: cat $1 | tr -d "\r" > $1 Obviously, such a script must convert only text files such as .html, .cgi, etc. You could conceivably put such a script in a pseudo printer print command to convert single files on the fly, but that's kind of involved given that you'll need to define the destination directory. The other possibility is simultaneous use of text files from both Unix and Windows. That's an editor issue. Wordpad and many other editors can handle it. You can download vim from vim.org and use the same editor on both Unix, DOS and Windows. In VI, you simply do the proper :set fileformat= and then save. Hope this helps. Steve Litt At 12:56 PM 12/29/1999 +1100, you wrote:> >Is there any option that will covert a text file from one system >to the other? I have a few files on linux with extension TXT. There are >plain text files. On NT, TXT is associated with the "notepad" and opens >with the file as one long string. This is the typical CR/LF conversions >between Unix and DOS. > >Can Samba convert the text files based on the client? > >Subba Rao >subb3@attglobal.net >http://pws.prserv.net/truemax/ > > => Time is relative. Here is a new way to look at time. <>http://www.smcinnovations.com >