1753505 Members
5433 Online
108794 Solutions
New Discussion юеВ

Re: VMS filesystem

 
Darijo
Frequent Advisor

VMS filesystem

Hello!

Why doesn't VMS respond with error message when you want to enter the directory which doesn't exist, but instead it behaves like it does exist???
26 REPLIES 26
Jan van den Ende
Honored Contributor

Re: VMS filesystem

Darijo,

>>>
when you want to enter the directory which doesn't exist,
<<<

What exactly do you mean by that?
What command?
Is error reporting enabled.disabled (via SET MESSAGE)

Please supply more info.

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Robert Gezelter
Honored Contributor

Re: VMS filesystem

Darijo,

Where appropriate, OpenVMS does return error codes. What command does your post refer to?

As a guess, your post refers to SET DEFAULT. Among other things, SET DEFAULT to a non-existent directory allows a subsequent CREATE/DIRECTORY [] command to create all directories in the path.

As a sample, do EITHER:

SET DEFAULT [.XX]
SET DEFAULT [.YY]
SET DEFAULT [.ZZ]

or

SET DEFAULT [.XX.YY.ZZ]

One is then able to do a CREATE/DIRECTORY [] and everything works correctly. One can argue that SET DEFAULT should check, and that the above behavior is a side effect, but that is the way it has always been, setting the default to a non-existent directory is not the error, using it as an actual reference is.

- Bob Gezelter, http://www.rlgsc.com
Kris Clippeleyr
Honored Contributor

Re: VMS filesystem

Darijo,

When you're logged in on a VMS system, and you do a SET DEFAULT you do NOT "enter" a directory, you simply change the default device/directory specification for your process.
Normally, whenever you try to access a file, you have to specify a valid file specification, i.e.:

node"access-control-string"::device:[directory]filename.type;version

To make our lives a bit easier, the VMS file system allows us to "forget" certain parts of this file specification, and will supply defaults.
The "node" defaults to the system you're logged in to.
The "access-control-string" is used in combination with an explicit "node" specification, so you can have a look at files sitting on storage devices on another system.
The defaults for the "device" and "directory" specifications are established at the time you log in (or are inherited), or are established/changed by a SET DEFAULT command.
It is only at the time the VMS filesystem has the need of using these defaults that a warning/error will be given if you specified either a device or a directory that does not exist.

Hope this helps,
Kris (aka Qkcl)
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Steven Schweda
Honored Contributor

Re: VMS filesystem

Why shouldn't it do what it does? UNIX
compatibility? (Not a good reason.)

> [...] CREATE/DIRECTORY [] [...]

Exactly. I find this very convenient. Why
doesn't UNIX do it this way?

Strictly speaking, VMS doesn't behave as if
the directory exists. It simply doesn't care
whether it exists until you try to do
something with it.

alp $ set default [.no-such-dir]
alp $ show default
ALP$DKA0:[SMS.no-such-dir]
%DCL-I-INVDEF, ALP$DKA0:[SMS.no-such-dir] does not exist

Note: Only "-I-", so it's still a success.


Interestingly (to me, at least), I've noticed
that running UnZip in a non-existent
directory will get that directory created for
you:

alp $ unzip [-]VX.ZIP;1
Archive: ALP$DKA0:[SMS]VX.ZIP;1
inflating: [.vx]vx.mail
inflating: [.vx]zip_bug.txt
inflating: [.vx]zip_bug_u.txt
alp $ show default
ALP$DKA0:[SMS.no-such-dir]

Clever program. (Or perhaps it's just
lucky. Nice either way.)
Jan van den Ende
Honored Contributor

Re: VMS filesystem

Darijo,

Yes, I assume Bob guessed correctly.

Now it becomes an issue of semantics.

You phrase it as "enter the directory", and, and in practise I often here people talking about "sitting in " or "standing in " or "going to" a directory.
As a matter of speach that may be entirely acceptable, but literally, if you try that you will get quite dizzy spinning at 10 or 15 K rpm! (and I do not have any visualisation of how that would work out in solid state!).

Actually, VMS phrasing is pretty exact: what

SET DEFAULT
does, is, it SETs a DEFAULT string in process memory, and that default string is used every time an incomplete file reference is used, to parse that reference to give the complete file syntax.

Play around with parse (from DCL: the lexical F$PARSE, see HELP LEXICAL F$PARSE ARGUMENTS) and the default file spec field, to get the feel of it.

And yes, (yet) (partly) non-existing filespecs are allowed, if for no other reason than to be able to specify what is be be created.

This background info also makes it easier to understand phenomena as eg:

DIR DEVICE:

now, if DEVICE is another device as the device part previously specified by SET DEFAULT, and the default directory does not exist on DEVICE, the effect becomes evident.

eg

$ SET DEFAULT MY_DEVICE:[MY_DIR]

$ DIR OTHER_DEVICE:
%RMS-E-DIRNOUTFOUND directory OTHER_DEVICE:[MY_DIR] does not exist
(well, something like that, I am not at a VMS system at the moment so this is from bio memory)

The DIR command specified OTHER_DEVICE, so that was used in parsing.
it did NOT specify a directory, so THAT part of the filename was supplied from the DEFAULT setting.
(for completeness: the DIRECTORY command by its own default supplies a default filespec of *.*;* )

hth

Proost.

Have one on me.

jpe
eg
Don't rust yours pelled jacker to fine doll missed aches.
Darijo
Frequent Advisor

Re: VMS filesystem

Hey guys!

Well here's the issue:

MZR1L2::set def [-]
MZR1L2::dir

Directory AEC:[000000]

AEC_SERVICE.DIR;1
1 8-SEP-2006 14:45:55.07 [AEC,SYS] (RWE,RWE,RWE,R)
LOG.DIR;1 1 8-SEP-2006 14:45:01.30 [AEC,SYS] (RWE,RWE,RWE,R)
MCC.DIR;1 1 8-SEP-2006 14:45:01.00 [AEC,SYS] (RWE,RWE,RWE,R)
MYDIR.DIR;1 1 5-OCT-2006 10:13:30.03 [AEC,SYS] (RWE,RWE,RWE,R)
RELEASE.DIR;1 1 9-AUG-1995 09:53:00.82 [AEC,SYS] (RWE,RWE,RWE,R)
SCRATCH.DIR;1 60 8-SEP-2006 14:45:01.21 [AEC,SYS] (RWE,RWE,RWE,R)
SHR.DIR;1 1 8-SEP-2006 14:45:01.09 [AEC,SYS] (RWE,RWE,RWE,R)
TOOL.DIR;1 1 26-AUG-1999 19:00:45.41 [AEC,SYS] (RWE,RWE,RWE,R)

Total of 8 files, 67 blocks.
MZR1L2::
MZR1L2::set def [.fake]
MZR1L2::dir
%DIRECT-E-OPENIN, error opening AEC:[000000.FAKE]*.*;* as input
-RMS-E-DNF, directory not found
-SYSTEM-W-NOSUCHFILE, no such file
MZR1L2::
Jan van den Ende
Honored Contributor

Re: VMS filesystem

Darijo,

re-read my answer.

It contains a similar example, with the explanation.

hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Darijo
Frequent Advisor

Re: VMS filesystem

Im still confused but I think I got it...sort of :)
What is the advantage of this filesystem?
Im coming from UNIX so this is very new to me.
Darijo
Frequent Advisor

Re: VMS filesystem

"Strictly speaking, VMS doesn't behave as if
the directory exists. It simply doesn't care
whether it exists until you try to do
something with it."

So does the filesystem allocates some drive blocks and then immediately unallocates them or...???
Why such a behaviour anyway?