tags:

views:

555

answers:

5

I am trying to copy C source files from a vms alpha to a windows machine to allow easier editing of the code. (VMS editor is just a text editor and it would be nice to have syntax highlighting etc)

I can copy this across using Exceed FTP and this handles the issue of duplicate filenames with version suffix that vms has:

  • File.c;1
  • File.c;2
  • Flle.c;3

But when I open a file I've transferred, all the line breaks have been lost and the entire file is just one line.

Can anyone recommend a solution to this or offer any hints?

Thanks in advance

ps. I need to be able to copy the files back to vms and still maintain format.

A: 

Some editors, such as BBEdit on the Mac, support directly opening/saving files via FTP/SFTP/etc. (BBEdit also supports various different line endings as used on different platforms, which would help with your other problem). I expect there must be a Windows editor with similar functionality - my Windows-using colleagues all rave about something called CodeWrite (or CodeWright ?) so I guess I would take a look at something like that.

Paul R
+1  A: 

I found some interesting information about OpenVMS text file structure. That corresponds with a vague memory I have of how VMS handles text files; they're not stored as streams of bytes like Windows and Unix systems, but as a sequence of records (each record is a text line). Records can be either fixed width or variable width. Whatever reads the file is responsible for the "paper control", what we normally call newlines these days.

You might check the options in Exceed FTP to make sure that you're transferring the file in an appropriate ASCII mode. There might be special options you need to set on the FTP server to read and write the files in the appropriate mode too.

Greg Hewgill
I'm sure any FTP will properly copy a text file. It's the server that will be reading the file record by record, and adding newlines in between. Correspondingly, when you send, a new record will be written for every newline.
John Saunders
+1  A: 

Copying a file to and from your windows desktop every time you want to edit gets old very quickly.

You may be able to implement a much nicer alternative. There is some software under VMS that permits a VMS directory tree to be treated as a "network disk" under windows. Once you've set it up, and set up your windows to recognize the network disk, you can just open the file with a windows text editor without moving it from VMS to windows. You can also browse the directory tree, which appears like a tree of folders.

When you issue a save from your text editor, the saved copy supercedes the previous version over in VMS land. And it mediates correctly between RMS format and embedded newline format. It's a whole lot more convenient than FTP, for this purpose.

After doing a quick Google search, I think the name of the VMS software is PATHWORKS. But I'm not sure.

Walter Mitty
+1  A: 

It may be off interest by now, but in case you still wonder about "one-line" text files after FTP transfer.

The short answer: force the FTP transfer mode to ASCII (or text) in your FTP client. This will make sure that the C-files you transferring (in fac all files) are treated as text, otherwise they're assumed to be binary, so you get a byte-stream.

Long answer: There're 2 FTP transfer modes: ASCII/text and binary/image. The default is sometimes clent or server-specific.

Many clients have Auto-mode that interprets the file extension to set the proper transfer mode (.TXT,.CSV etc..)

When you access the VMS server via FTP client, too often the [Win-based] client is not VMS friendy, so it does not parse the file-list properly. Thus it gets confused by version number appended to the "usual" file-name: filename.ext;ver ==> file.c;1

So instead of seeing .C (and assuming text), it sees .C;1 and thinks it's binary.

I use Filezilla FTP client to/from VMS and so far it does it properly (though version-support is not as I'd sometimes like).

vmsnomad
filezlla worked for me too
Matt Joslin
+1  A: 

A few points I have on this

  • PATHWORKS is fairly old and (as far as I recall - I dont use it) doesnt work well with recent windows versions, such as supporting Active Directory. Within the last few years HP have ported SAMBA to VMS and this is the way to go if you want to make areas of disk visible to windows machines. Should be easyt to find on HP web site.

  • If you want to try the FTP/SFTP route I would try SFTP and go for VMS version of at least 8.2. TheTCPIP suite was rewritten (or reported from a Unix version) at this point.

  • VMS supports a number of formats for text files. As well as the complex record structure described above, there is STREAM_LF which is the same as a unix file and STREAM_CRLF

justintime