1820602 Members
1746 Online
109626 Solutions
New Discussion юеВ

setting SAMBA to ascii

 
Richard Woolley
Frequent Advisor

setting SAMBA to ascii

Hi everyone,

I have samba installed on my machines, however in a lot of cases the text files my users are transferring seem to be transferred in binary mode.

Does anyone know if there is a way i can set the transfer of these files to ascii mode.

At the moment this would be a good solution if the files samba transferred got to their destination in the same format as they came from.

cheers,

mark.
3 REPLIES 3
Darren Prior
Honored Contributor

Re: setting SAMBA to ascii

Hi Mark,

Samba is intended to act similarly to network shares from Windows machines, in that files are transfered in binary.

Am I right in thinking that you want some kind of dos2ux conversion on the files? If so, you will need to do this manually as I'm not aware of this functionality within Samba. There are a number of other threads on this forum discussing the differences between text files on HP-UX and on Windows/DOS machines.

Perhaps you could give us some examples of what you're seeing and what you're expecting to see in your files.

regards,

Darren.
Calm down. It's only ones and zeros...
Arnold Hausmann
Occasional Advisor

Re: setting SAMBA to ascii

Hi, I have a similar issue that I had to solve with dos2ux program.

We use PVCS on a Windows server to store Unix shell scripts, Oracle SQL scripts, etc. The only way to move files between is FTP or Samba--we chose Samba as more "secure" than FTP with a user/password hanging out for all to see.

The Windows "copy" command is binary, so I had to convert the files. I chose to convert on the Windows platform as I had control of the script and actions via an awk script.

If you choose to do the same, the attached source compiled with any Windows compiler will do the trick.

Stuff happens...that's why Jesus saves.
Bill Hassell
Honored Contributor

Re: setting SAMBA to ascii

SAMBA is not like ftp where you have options to control transferring a file. In fact, SAMBA doesn't transfer files at all! It is a remote filesystem, just like NFS so what you see on the PC share (or what PC sees on the HP-UX share) is exactly what exists. Unix and PC-windows filesystems are quite unrelated so you can always expect difficulties. If SAMBA were to translate ASCII files, how would SAMBA know the file was ASCII? SAMBA interfaces with the filesystem directories and opens the file as if it were local. Not even HP-UX knows whether a file is in ASCII format or not.

So you may want to rethink the use of SAMBA. If what you want is to quickly transfer the files between the systems, a batch FTP script is the way to go. If you want to edit the files on a different machine, users must ALWAYS be aware of the differences between Unix and DOS.


Bill Hassell, sysadmin