DNCOPY(1)

πŸ“¦ version 2.65build2, in ubuntu jammy

okay bestie, sit down, hydrate, breathe β€” because you just opened dncopy(1), a page from the General Commands Manual, and she is that girl. πŸ¦‹βœ¨ this is your one-stop shop for yeeting files back and forth between Linux and VMS. no cap.


✨ NAME ✨

dncopy β€” copy files to/from a VMS system πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

dncopy [options] source dest
dncopy [options] source... directory
dntype source...
Options:
[-vdisklEVh] [-m mode] [-a record attributes] [-r record format] [-b
block size] [-p VMS protection]

like… she contains multitudes, three whole invocation shapes, and she serves all of them. πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

dncopy copies files to and from VMS systems. that's the whole personality. iconic, honestly.

So when you're naming a file on a VMS system, you use the usual transparent DECnet format:

node"username password"::[directory]file

and ngl, to keep quotes and dollar signs from getting shell-expanded on you (rude of the shell, fr), I highly recommend wrapping every VMS file spec in single quotes β€” peep the EXAMPLES below. πŸ“Œ And if you do not feel like typing your password out loud on the command line, just drop a hyphen (-) where the password goes and she'll prompt you for it. privacy queen. πŸ™ˆ

dncopy can do single files and multiple files, she's flexible like that. πŸ’β€β™€οΈ If you're copying multiple files, the destination must be a directory β€” but no stress, it can be a directory on your local Linux box or on a VMS system. And the files you're copying can be a mix of VMS files and local files. yes bestie, you can copy from VMS to VMS with this program β€” though quite why you'd want to, I'm not sure. 😭

Wildcards? supported, for local and VMS files (the local ones get expanded by the shell, obviously, she's not doing that labor herself). Just remember the rules of the land: use VMS wildcards (*%) on VMS filesystems, and Unix wildcards (*? and friends) on Unix files. don't mix them up, that's the vibe check. 🌸

The pseudo-filename - is your bestie for representing standard input or standard output, which is what makes dncopy play nice in a pipeline. 🫢 And heads up: filenames get changed to lower case when copied from VMS to Linux. periodt.

The environment variable DNCOPY_OPTIONS can hold a default set of options for copying files. So say β€” totally hypothetically β€” you wanted to normally send files as blocks instead of records, you'd set DNCOPY_OPTIONS="-mblock". Then, to send a file as records, you'd need to type:

dncopy -mrecord myfile.txt vmsbox::

Options in DNCOPY_OPTIONS can be overridden by options typed on the command line… except where there's no negating option available (see -k -d -i). if you put those in DNCOPY_OPTIONS then to remove them you have to override the whole environment variable, like:

$ DNCOPY_OPTIONS="" dncopy myfile.txt vmsbox::

and dntype? she's just a version of dncopy where the output file is forced to -. so she takes all the same options as dncopy, because she is dncopy wearing a different outfit. it's merely a convenience. πŸ’…


🌈 OPTIONS 🌈

  • -v β€” Verbose operation. The more -v options you stack, the more verbose dncopy gets. One -v is roughly equivalent to the /LOG qualifier on the DCL copy command. More than one is really just useful for debugging. πŸ”
  • -i β€” Interactive operation. Prompts before copying a file. Roughly equivalent to the /CONFIRM qualifier on the DCL copy command. πŸ‘€
  • -l β€” Ignore interlocks on files copied from VMS. She'll do her best to read the data regardless of record or file locking, but it won't always succeed. bestie tried her best. 😭
  • -s β€” Show transfer statistics. This shows the throughput of all copies (in the case of wildcard transfers) undertaken, in K bytes/second. This time does not include the time to establish the connection β€” e.g. when sending to VMS, the overhead of creating a NETSERVER process is not included. ⏱️
  • -k β€” Keep version numbers on files copied from VMS systems. By default dncopy strips the version number from files because they have no meaning in Linux. If you specify -k on the command line then the VMS file will be created with exactly the same name as it had on the VMS system. To access these files under Linux you'll need to enclose them in quotes, eg less "vmsfile.txt;1". πŸ™ˆ
  • -m {record|block} β€” Sets the transfer mode to block or record. record is the default. Normally record is what you want, but block is used for sending binary files to the VMS system. ⚠️ Note that if you use -mblock to pull files from VMS you may not be able to make sense of the file on Linux, because dncopy will also pull all the VMS internal structuring of the file as well as the data. Unless you really know what you're doing, -mblock is only really useful for sending files. 🧚
  • -a {none|ftn|cr|prn} β€” Sets the carriage control attributes for files copied to a VMS system. The default is cr.
  • -r {fix|var|vfc|stm} β€” Sets the record format for files copied to a VMS system. The default is stm. In fact the default is STREAMLF, because this corresponds to the format of files on Unix systems, so it's the least likely to result in file corruption. πŸ›‘οΈ If you're sending a pure text file then var or vfc may be more appropriate for your application. fix may be useful for block-structured files and data files.
  • -b N β€” Set the block size for transfers. The default is high enough for all record structured files. If you're sending a file with -mblock then you should use this to set the block size of the file to be created at the VMS end. When sending block files the default changes to 512, as this is typically what you'd want (I hope). 🀞
  • -d β€” Remove any trailing CR characters at the end of a line. This is useful for sending DOS files to VMS. Only works when transferring in record mode.
  • -p 'protection' β€” When sending files to VMS, sets the protection of the newly created remote file. Without this option, VMS will set the protection to be the default for the remote user. The protection should be in VMS-style format and enclosed in single quotes to protect it from the shell (see example). This option is ignored when copying from VMS. πŸ”’
  • -P β€” Queue the file for printing to SYS$PRINT when it arrives at the VMS end. πŸ–¨οΈ
  • -D β€” Delete the file when it is closed. This is only really useful in conjunction with -P.
  • -T connect timeout β€” Specifies the maximum amount of time the command will wait to establish a connection with the remote node. A 0 here will cause it to wait forever. The default is 60 seconds. ⏳
  • -E β€” Ignore errors opening output files. This is handy if you're sending a lot of Unix files to VMS, some of which have illegal filenames (eg ~ backup files). dncopy will report an error for each file but continue sending. πŸ’ͺ
  • -h, -? β€” Displays help for using the command. πŸ†˜
  • -V β€” Show the version of the tools package that dncopy comes from.

πŸ“ ENVIRONMENT VARIABLE πŸ“

You can put your most commonly used defaults in the environment variable DNCOPY_OPTIONS, eg:

bash or ksh:

$ DNCOPY_OPTIONS="-mblock -anone -b1024" ; export DNCOPY_OPTIONS

csh or tcsh:

$ setenv DNCOPY_OPTIONS "-mblock -anone -b1024"

which makes dncopy send files as 1024 byte blocks with no carriage control. so clean. ✨

You can override these options by specifying replacements on the command line as usual. But be aware: some options have no converse (eg -i -k -d -v), so if you put these in DNCOPY_OPTIONS you can't disable them without deassigning the variable. them's the rules. 😀


πŸ’– EXAMPLES πŸ’–

Copy LOGIN.COM from the VMS system "tramp" to Linux as mylogin.com:

dncopy 'tramp"christine pjc123"::login.com' mylogin.com

Copy all .TXT files from the VMS directory SYS$SYSDEVICE:[WP] to /tmp:

dncopy 'tramp"christine pjc123"::sys$sysdevice:[wp]*.txt' /tmp

Copy an executable to VMS:

dncopy -mblock test.exe 'tramp"christine pjc123"::[.BIN]'

Copy a file to VMS and set its protection:

dncopy secret.dat  marsha:: -p (s:, o:rwed, g:re, w:)'

Display the contents of LOGIN.COM:

dtype 'trisha"christine -"::login.com'

You will then be prompted for a password. πŸ”


πŸ‘‘ HELPFUL HINTS πŸ‘‘

For fetching files, the defaults should serve for most purposes. Most VMS files are record orientated and -mrecord is the default transfer mode. It's rare you'll need to fetch files using -mblock, because you'll get all the record control information downloaded too, and that probably isn't any use to you. πŸ™…β€β™€οΈ

Sending files is more complex, because VMS supports far more attributes than Linux, so you'll need to know something about the file you're sending. Text files should be OK with the defaults, unless you need to change the format from the default STREAMLF to VFC or VAR. Carriage control can also be specified, if you want to be that picky. πŸ’…

Binary files may often need to be sent -mblock to be useful at the VMS end. You'll probably want to specify a block size with the -b option. The default is 512, which is fairly useful, but if you're sending (say) a saveset, 8192 or 32256 may be required. Trial-and-error may be the only way in some cases, unless you know the file contents very well. πŸ˜΅β€πŸ’« If you really don't know what to do, just send it -mblock and use the set file/attr command to massage it on the VMS end until you're happy with it. (If you're using VMS earlier than 6.1 then you'll need the freeware FILE utility to do this.) πŸ§šβ€β™€οΈ


🌸 SEE ALSO 🌸

dntype(1), dndir(1), dndel(1), dntask(1), dnsubmit(1), dnprint(1)


and that's the page bestie!! πŸŽ€ this whole thing comes to you from the DECnet utilities, dated January 26 2005 β€” yes she's vintage, yes she still eats. now go forth and copy some files. slay, periodt, dncopy(1) forever. πŸ‘‘πŸ’–

πŸ“¦ where this page comes from