VMS like or type "logicals" in Windows?

davism
davism used Ask the Experts™
on
Hi all,

I was always really fond of the ability in OpenVMS to use logicals, and the searchlist ablities on the fly at command time.

I know windows has the PATH statement but the implications changing it has further reaching impacts meaning I will need the core PATH statement to accommodate for the things like "program files\.{product directory}... etc" and I need the specific item at run-time to be included or maybe I'm just missing something. I like the aspect of being able to create a logical in VMS called like DATF and it references a searchlist of directories. I want to be able to use something like DATF (or some name) in windows and have it refer to different directories.

Any thoughts on how this might be able to be achieved in a Windows OS?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Hi davism,

VMS, huh? :)  Not really my cup o' tea ... but if I'm interpreting your post correctly, I think you're after something similar to the Libraries feature in Windows 7.

See the links below:
http://windows.microsoft.com/en-us/windows7/products/features/libraries
http://www.makeuseof.com/tag/windows-7-libraries-%E2%80%93-and-why-you-want-them/

Feel free to clarify if you're looking for something else. I'll admit that it's been quite awhile since I played with VMS, and I'm not familiar with DATF.

Hope this helps!
-Mark
Commented:
Or how about symbolic links (a la mklink, from the CLI)?
http://technet.microsoft.com/en-us/library/cc753194%28WS.10%29.aspx

-Mark

Author

Commented:
mark1208,

This is a bit intriguing. I have Windows 7 on another drive and will have to take a look at that.

I'll need to see if I can do this from a command line or programmatically, This would be interesting.

By the way, the DATF reference was an EXAMPLE of a LOGICAL NAME.  (i.e. DEFINE DATF DK01:[TEST])

I will take a look...
Expert Spotlight: Joe Anderson (DatabaseMX)

We’ve posted a new Expert Spotlight!  Joe Anderson (DatabaseMX) has been on Experts Exchange since 2006. Learn more about this database architect, guitar aficionado, and Microsoft MVP.

Commented:
Pardon my ignorance.  :)  So in VMS-land, the file or directory  referenced by the DATF logical is the same as that which resides on  DK01:[TEST]?
 
 If so, symbolic links, hard links, or directory junctions via mklink are exactly what you're  looking for. It's basically a combination of ln and symlink from  the UNIX/POSIX side of things, where logical references can be created  which point to other targets (either local or remote).


 Glad to help otherwise if you had something else in mind.

Happy reading!
-Mark

Author

Commented:
Yes, when I was reading that a little more the link sounds like it may work. Is that Vista only? If so, I'm again going to have to wait until later when I am on that machine with a vista OS.

In addition, I have to look to see if I can do a logical search path which is essentially a list of directories which can be on different devices. (i.e. C drive, D drive, E drive or different shares). It's sorta like the LIBRARY functionality in Windows 7.

Either way, I will take a look at these.
 
Will let you know...

Commented:
mklink is available on Vista, Windows 7, and WS2008.

For XP, you'll have to use SysInternals Junction (http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx), linkd from the Windows 2000 or WS2003 Resource Kit, or the scary-yet-powerful fsutil command-line tool. Note that these are only for directory symbolic links (a.k.a. NTFS junctions in Windows-land). I'm not sure that NTFS 3.1 (XP, WS2003) supports symbolic links at the file-level, the way that mklink allows in post-Vista OSes.

Regarding the logical search path, are you trying to ensure that files can be located using Windows Search (Vista, Windows 7)? Or are you trying to ensure that executables within the symbolic link can be launched regardless of the current system path (i.e. the way that the %path% environment variable works)?
nociSoftware Engineer
Distinguished Expert 2018
Commented:
Logicals is a kernel name space where you can connect objects.
Queues, Disks, Mailboxes, Files, etc.

The kernel looks for f.e. SYS$BATCH and it can be translated to the actual batch queue that is intended for you environment.

The name space is split into:
Process (process private)
Job (running Job)
Group (UIC/username based)
System wide
Clusterwide,

And searched in more or less the same order.
Meaning that f.e. SYS$BATCH can have a system default of SYSTEM_QUEUE and that
system management (Group 1) can assign themselves a different queue through a SYS$BATCH logical in the Group table for group 1.

etc.
The disk APPLICATION_DISK can be DKA100: for one job and DKA200: for anotherone.
Logicals are a powerful feature that allows for virtualisation of process environments.

This feature is Unique for OpenVMS.
If you restrict yourself for Systemwide only Filename targeted logicals then SYMLINKS can be used...
If you use logicals like:  DATAFILE
where datafile means DKA100:[USER1.DATADIR]FILE.DAT for one user1
and DKA100:[USER3.DATADIR.SUB]FILE.DAT for user3 each running a program that
tries to op DATAFILE then there is no equivalent.

And PATH is not an equivalent for SEARCH-PATH's as suggested before.

A search path is like a PATH but only for that translation...
F.e.    DATAFILE points to PERSONAL:FILE.DAT,SHARED:DATAFILE.DATAFILE.SHARED
then Personal is DKA100:[USER1.DATADIR] for user1, DKA200:[USER3.DATADIR] and the SHARED: pointes to DKA500:[SHARED]

Then the app will open
DKA100:[USER1.DATADIR]FILE.DAT for user1
DKA200:[USER3.DATADIR]FILE.DAT for user3

and user 4 not having a FILE.DAT in his datadir.
will get access to DKA500:[SHARED]DATAFILE.SHARED.

Besides the previous mentioned namespaces a system manager is free to create his own name space...
Think of logicals names only for the Financial Controllers:
LEDGER_TABLE  holding all translations need to use the bookkeeping software.

Off-course all these tables have their own access protection so only qualified people can access them.


nociSoftware Engineer
Distinguished Expert 2018

Commented:
Oh the previously mentioned SYMLINKS are most like SYSTEM WIDE logicals with the difference that they are stored on disk and not in memory.
The reparse points are in memory (equivalent to mount --bind for UNIX).

If you care to modify the programs you might be able to use environment variables to do translations. You need to do all translations and knitting of filenames yourself.


strcpy(file, getenv("NAME"))
strcat(file,"\\")   /* or strcat(file,"//") if in unix */
strcat(file,"FILE.DAT")

etc.

Commented:
I am sure there are DCL emulators out there that might offer functionality. WinDSL comes to mind from a few years aback. not sure if it is still available.

A simple DCL parser for DOS.
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012

Commented:
<<need the specific item at run-time to be included or maybe I'm just missing something.>>

No, your not missing anything.  VMS has some very unique features (logicals, symbols, and DCL), which make it very nice to work with in terms of accomplishing tasks within the OS.
DCL can be replaced with VB script, symbols partially with environment variables, but there is nothing like logicals in Windows.
JimD.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
Please note you cannot compare logicals to environment variables.
For DCL the SYMBOLS are 100% equivalent to environment variables.

For OpenVMS (note the difference, the KERNEL not the command interpreter) handles logical names. Because they reside in kernel space the kernel can trust their values (esp. so called Executive mode logical names) and use it to access objects using a translated name.

Author

Commented:
TimPeer, one I reallly utilized A LOT of in different compacities previously is XLNT from Advanced Systems Concepts - www.advsyscon.com. It was excellent but didn't do logicals, per say.

noci,

In some quick evaluation on my Vista system the mflink seemed to work ideally. With respect system level logicals there are also group level. I would not want to invoke or utilize any system level logicals (comparable to that of like SYS$LOGIN.

What I want to do for this is like a a search path and in that since it is like a PATH.

In your example:

"If you use logicals like:  DATAFILE
where datafile means DKA100:[USER1.DATADIR]FILE.DAT for one user1
and DKA100:[USER3.DATADIR.SUB]FILE.DAT for user3 each running a program that
tries to op DATAFILE then there is no equivalent."

If I have a logical in a group level logical name table for like DATAFILE:  I can have that DATAFILE equate to DKA100:[DATF]FILE.DAT, DKA200:[DATF]FILE.DAT, DKA300:{DATF]FILE.DAT.  In that situation whomever utilizes that logical name table will and reference DATEFILE. It will look through DKA100:[DATF], DKA200:[DATF], DKA300:[DATF] and it will utilize the first location that the FILE.DAT and if none of them have that they it will fail in a FILE NOT FOUND type situation.

I did part of that with the mflink but I ran out of time to test whether or not it would find and utilize the like the FILE.DAT in the directories I specified.

The use of the LIBRARY in Windows 7 seeming would work as well (albeit I didn't get a chance to try being that I ran out of time) but I'm not sure if I can use that programmatically or from a command line.

JDettman, from a SEARCH-PATH prospective would you think that the MFLINK or LIBRARY would be as close a possible to a LOGICAL?   Albeit, the whole concept of LOGICAL NAME TABLES may or would be a little different.



Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012
Commented:
<<JDettman, from a SEARCH-PATH prospective would you think that the MFLINK or LIBRARY would be as close a possible to a LOGICAL?   Albeit, the whole concept of LOGICAL NAME TABLES may or would be a little different. >>
MFLINK gets pretty close; a lot closer then what I thought was available in Windows.  

Learn something new every day...
JimD.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
I agree with JDettman,

Translation of a single name seems to be possible. Not sure if you can make the mkflink per process or systemwide only though.
The link with the filesystem seems to suggest it is for everybody the same. (SO it would be the equivalent for a single valued system logical name).

I can't find anything about searchlist like functionality.
Personaly I have no windows systems, at work it's limited to Windows-XP.

Author

Commented:
Thanks guys!

I think the MFLINK is the best source albeit is does have some limitations include the ability in XP (albeit, a manner is possible with the resource kit).

Thanks and much appreciated!!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial