[comp.os.msdos.misc] Simbolic Links

umrose05@ccu.umanitoba.ca (Dave Rose) (01/02/91)

Hi,
	Does anyone out there know how to create a symbolic link in
dos?? Basicly what I want to do is have a directory name that is just an
alias of the real directory on another drive...Is this possible? I know it
is in unix with the ln command, but I desperately need it in dos.
 

-- 
Dave Rose                 : Local (UnixWS) - UMRose05@CCU.UManitoba.CA
P.O. Box 403              : Local (Amdahl) - #Rose05@CCM.UManitoba.CA
Winnipeg, Manitoba, Canada:      UUCP Node - drose@draco.UUCP
R2M-5H3                   : 

silver@xrtll.uucp (Hi Ho Silver) (01/04/91)

In article <1991Jan1.165121.10930@ccu.umanitoba.ca> umrose05@ccu.umanitoba.ca (Dave Rose) writes:
$	Does anyone out there know how to create a symbolic link in
$dos?? Basicly what I want to do is have a directory name that is just an
$alias of the real directory on another drive...Is this possible? I know it
$is in unix with the ln command, but I desperately need it in dos.

   No can do.  The structure of DOS filesystems is very different from
that of Unix filesystems, and is not designed to permit linking.
-- 
 __            __  _  | ...!nexus.yorku.edu!xrtll!silver |  always
(__  | | |  | |_  |_) >----------------------------------< searching
 __) | |_ \/  |__ | \ | if you don't like my posts, type |    for
_____________________/  find / -print|xargs cat|compress |   SNTF

mlord@bwdls58.bnr.ca (Mark Lord) (01/04/91)

In article <...> silver@xrtll.UUCP (Hi Ho Silver) writes:
<In article <...> umrose05@ccu.umanitoba.ca (Dave Rose) writes:
<$	Does anyone out there know how to create a symbolic link in
<$dos?? Basicly what I want to do is have a directory name that is just an
<$alias of the real directory on another drive...Is this possible? I know it
<$is in unix with the ln command, but I desperately need it in dos.
<
<   No can do.  The structure of DOS filesystems is very different from
<that of Unix filesystems, and is not designed to permit linking.

Ok.  Here is f-link, which does DOS symbolic links in a peaceful fashion.
I do not know if it works for directories, but it DOES work for files.

It's been ages since I toyed with it.  Somebody else wrote it and
posted it about 2 years ago (I think).  I'd forgotten about the lack
of documentation.

From looking the files in f-link.zip, here is what I have figured out:

    F-LINK.EXE is a TSR to be loaded in your AUTOEXEC.BAT.
    It intercepts open_handle (NOT FCB!!) requests, and looks at
    the first 4 bytes of the file to be opened.  If they are FLFL,
    it then takes the rest of the short file to be the REAL pathname
    to open instead! It may or may not do further validation of contents.

    LINKFILE.COM/LINKFILE.C  is a program for creating the links.
    All that it does is create a fake file of the same name as the
    file you are trying to create a link for.  This "fake" file contains
    the characters 'FLFL' followed by the REAL pathname of the file.

    Usage:   move to the directory where the link is to appear,
             and then do:   LINKFILE full_path_of_physical_file

    For example:

         CD C:\PMASTER
         LINKFILE D:\NEWS\PICTURES\HOUSE.PIC

    This creates a link, C:\PMASTER\HOUSE.PIC, which actually
    references file  D:\NEWS\PICTURES\HOUSE.PIC

The cost of using this method is exactly one cluster per symbolic link,
required to hold the fake file with the 'FLFL' and forwarding pathname.

[ IMHO: a reasonable cost for something that is automatic and
  100% transparent to DOS and chkdsk and norton and pctools and.. ]

begin 644 f-link.zip
M4$L#!`H````&`/&!0A1J`6S>KP$``$`$```*````1BU,24Y++D5810\`$@,DF
M%38G.#EJ>TR=;A\)!@$3-.7VEO>;:@4*<"#`@@!!+/O__R2*O7%^I@`O`O20^
M[`$!GA`>X(QA_Q/MEH:]V+#%$?!_P8`W-3K5P-B`@P3,GR?=!\3WI*N`^*UT@
M"ZJ;5I>CP0R?V*%8@%*GX@;8D[/+_Q[I`I2[=#%VCPX_ZH8(,#=4@+1_4-.TR
M?1S3+@/[N-XHT[HAD%T"LF+438'Z4$7[HJ)MG/ZX5:MR`="4LG'K>DE+@0_81
M<ZI1NA9=#O:)P+*OF^#8%1Q[P&=3\<'Y!=8M/WC?\P1Q*=;/D`]8]SKND#6;W
MAV0,O`?W==WC?K&,%N_2L4&P`6DG>0YYCW;B=@M\IWX)9P9USM9U[3G[LR6!R
M;JC0:$NF29TN!9EV+LBP;.66#4LVC_)NY])9GFU9LBZZ)P&.MEM6[MRT;]V"J
MC.GR)DBT8=H76[:L&W4(-245N7`854YW(RXMG\O/S]S>_&6/OZ[+4-?TM!-X\
MCSL@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;X:44U+5"1C;"!8)`N3@B]>9K)>F>W3_/`RE&7#JUI8:*N^:(%QR:60^D9(Q
MHM;WDH.05.O*%?NVY5"0+4$.?0LWK]RT9]'2!8ER;$J0,7/BQ`E2Z%NY;,.Z\
M)0LRJ5NZ;/0XT;1VTY(M"[*L7#G6-U085*P;X]N&90L2CO-GY89M8_IAWS:M=
MV[!TT[YUTQW75##`=&PA6-H!3##@BJO.#7NVK$Z03),Z76HT*=.B(,VF95O&V
MVHTR"<Y;)T#T"18TB!`A0HH5"^AZ)^@1>.E_P7`((F>H8#NICQ1`;,GF_C_^G
M"SX4H$P%TR.(J><!DAX0+&$[!+,UH8"H$"^JX14*#/",!O?L`BZJ/>/PGGVHA
M`'T))BL(+X2$-V<<8H5B_?>,!O$,'L8S>"#/X*$\@P?S#![.,WA`S^`A/8,'.
M]0P>UC-X8,_@H3V#!_<,'MXS>``^U"`%!#M!T`)!-0%,,(2:_V?/&PRU@.!O[
M"P102P$""@`*````!@#Q@4(4:@%LWJ\!``!`!```"@```````````"``````B
M````1BU,24Y++D5815!+`0(*``H````&`'I^0A17?K&D+P$``-(!```*````N
M``````$`(````-<!``!,24Y+1DE,12Y#4$L!`@H`"@````8`LK-(%.0W[.,1L
M#@``2!4```P````````````@````+@,``$Q)3DM&24Q%+D-/35!+!08`````)
.`P`#`*H```!I$0``````J
``
end
size 4649
-- 
 ___Mark S. Lord__________________________________________
| ..uunet!bnrgate!mlord%bmerh724 | Climb Free Or Die (NH) |
| MLORD@BNR.CA   Ottawa, Ontario | Personal views only.   |
|________________________________|________________________|

userDHAL@mts.ucs.UAlberta.CA (David Halliwell) (01/05/91)

In article <1991Jan4.002336.7195@xrtll.uucp>, silver@xrtll.uucp (Hi Ho Silver) writes:
>In article <1991Jan1.165121.10930@ccu.umanitoba.ca> umrose05@ccu.umanitoba.ca (Dave Rose) writes:
>$       Does anyone out there know how to create a symbolic link in
>$dos?? Basicly what I want to do is have a directory name that is just an
>$alias of the real directory on another drive...Is this possible? I know it
>$is in unix with the ln command, but I desperately need it in dos.
> 
>   No can do.  The structure of DOS filesystems is very different from
>that of Unix filesystems, and is not designed to permit linking.
>-- 
   
.    I don't know about using a new directory name for a directory on
another drive, but if you are satisfied with a new drive letter, then the
SUBST command (external) should do the trick. Syntax is:
   
.      SUBST  d:    path 
   
You can then access the path by just specifying the new drive letter. The
drive letter you use must be different from the current drive, but it
can be the letter for an existing drive (e.g. B:) or non-existent (e.g. K:)
In the latter case, you are limited by whatever is specified by LASTDRIVE
(default is E).
  
.    You can remove the substitution using /d. You can look at the list
of active substitutions by typing just SUBST. Won't work on a network
drive, though.
  
Dave Halliwell

frisk@rhi.hi.is (Fridrik Skulason) (01/07/91)

In article <5165@bwdls58.UUCP> mlord@bwdls58.bnr.ca (Mark Lord) writes:
>Ok.  Here is f-link, which does DOS symbolic links in a peaceful fashion.
>
Ah - my F-LINK program...It was never really finished.  I wrote it just
to demonstrate that this could be done under MS-DOS.

It is usable but not finished - What I never got around to do was to make it
handle FCBs, but If I ever have the time I will finish it - the problem is
just the never-ending flow of new PC viruses, 3-4 per week - writing detectors
and disinfectors takes up most of my time...

--
Fridrik Skulason      University of Iceland  |       
Technical Editor of the Virus Bulletin (UK)  |  Reserved for future expansion
E-Mail: frisk@rhi.hi.is    Fax: 354-1-28801  |