Link to home
Start Free TrialLog in
Avatar of Marc Davis
Marc DavisFlag for United States of America

asked on

VMS like or type "logicals" in Windows?

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?
Avatar of mark1208
mark1208
Flag of United States of America image

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
ASKER CERTIFIED SOLUTION
Avatar of mark1208
mark1208
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Marc Davis

ASKER

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...
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
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...
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)?
SOLUTION
Avatar of noci
noci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of noci
noci

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.
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.
<<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.
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.

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.



SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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!!!