Win_Lnk back to the download page Contents OverviewState of development
InstallationDeinstallationThe extensions in detailFor Programmers
Win_Lnk served originally only to use the Windows links under MagicPC as real symbolic links. More and more other MagicPC extensions are also inserted. To do that some GEM-DOS-and AES routines are adjusted. In order to bend the BS routines Trapper is used.
This is one of the first public versions, so there still might be some errors. To install this programm you
have to copy unlnk.dll in the MPS Folder (which might have to be created) in the MagicPC-Folder. Win_Lnk.prg should be placed either in the Auto-Folder, Start-Folder or be called by the Autoexec.bat, but it can also be
started as a normal programm. But regardless of how it is started, Traper has to be active already! If you restart Win_Lnk when it is already active,you can deinstall it. But this might take time, if some reserved memory is still in use (Pexec,...). This is only true, if both instances of win_lnk have the same version number. But if for example a win_lnk 1.05 is running and you start a 1.06, than 1.05 is replaced by 1.06
From V 0.32 a log file can be written from
the Windows side. As from version 1.0 DOLOG is normaly undefinde.So if you want to use it you have to insert the #define.. The reason that I deactivated it was that this function caused as many errors as it helped to solve. For the
loging to work either the system variable LOGDIR or TEMP must be defined (on the Windows side!)! Alternatively one can also debug MagicPC ( Task manager.) Then, if DOLOG is definded but the loging is disabled, TRACE prints
into the debug window. Because some MagicPC versions have problems with this Debug-dll, I add only the release version. To the reactivate the log one must recompile the dll anyhow. In parentheses} the Gemdos-function numbers are given. The functions are listed In groups. Single functions can appear several times. Fcreate(60) Fopen(61), Pexec(75) and Fattrib(67) If these functions are applied to a link, this is followed. Indeed only if it hasīnt the extension .lnk. Because the Fileselector, Fsfirst/Fsnext, and D(x)readdir the LNK cut that extension off, this is the normal case. In addition, in Pexec Windows environment variables are added, see afterwards and it can instruct Windows to start Windows programs. Fcreate and Fopen are also changed for transferring of the clipboard see below. Pexec(75) and shel_envrn(AES 125) A problem of MagicPC is that it has no multi user abilities. An important point, are user dependent environments. Above all e.g., HOME. However, depending of the Windows version under which MagicPC runs this might be offered by the host system. So why not just transmit the environments from windows to MagicPC. Iīll explain it most simply by an example. If we would like to define HOME on the Windows side, then add the following line to Magx.inf: #_ENV HOME=%WIN% If HOME is used now, Win_Lnk recognizes that it should take the definition of HOME from Windows. However, if for some reasen HOME should have different values under both systems, then one can choose on Windows any other name,
e.g., HOME_MP. Then add the following line to Magx.inf:C.
#_ENV HOME=%WIN%:HOME_MPC
In the 1st case one must define HOME and in the 2nd HOME_MPC under Windows. Environments can be retrieved under MagicPC in 2 ways, either by shel_envrn that of the Shell, or from the own basepage. The latter is given down with
pexec or is defined newly. Therefore, both ways are suported. The syntax must be kept exactly, thus no additional blanks or similar. Win_lnk tries to interprete the variable as a filepath and if necessary transfer it from the
Windows path system to the MagicPC System. So define Pathes under Windows as Windows knows them. Fcreate(60) Fopen(61) Fclose(62) und Fdelete(65) if scrap.txt (in the suitable Directory) is opened in write mode(Fopen or Fcreate) win_lnk memorises the handle. If this file is closed later, win_lnk will copy the content to the Windows clipboard. Here the S_IFLNK bit is set if necessaryFxattr(300) According to the Flag links are followed or not. Folder links are always followed. returns the target of a link Dreaddir(297) und Dxreaddir (322) If a file is recognized as a link, the extension .lnk will be removed. If
then the filename is not unique any more a ~L will be added to the file name. In addition, in mode S_IFLNK is set. Letīs say there are the following 3 files in a directory::
if in 1) only the .lnk would be removed, 1) and 2) would not be distinguishable any more. file1~L.txt These both functions react as before, but since D(x)readdir needs some parameter from Dopindir, I save them here. And since this memory has to be freed sometime, I also had to change Dclosedir. The goal was to return short file names
(8.3) for links which however have the right extension. The normal Fsnext would return always a *.lnk. A problem are files which exist once as normal files and once as a link. In addition, the change of the extension had to be
reversible. Here an example: All lnk files are links. The normal Fsfirst would return these 9 names:
The file 2) wouldīnt be recognizable for an editor as a text file, and the files 4), 6), 7) 8) and 9) would have extensions meaningless to most users and programs. Therefore, the new Fsfirst/Fsnext routine return these names:
Should these files be opened later, e.g., with Fopen, Win_Lnk recognizes the ~ followed by a letter and knows that these are accordingly manipulated file names. And it can reconstruct the original 8.3 short names. "~L" and ". ~L " will get simply be eliminated ~A to ~J will be replaced by ~0 to ~9. In addition, if an extension exists it will be replaced by lnk or otherwise .lnk will be added. What I realy donīt like is case 4) but methode 6) is not aplicable for files with nomes of more than 6 chars. 9) is also not very nice. fsel_input (AES 90) and fsel_exinput(AES 91), rsrc_load (AES 110), shel_find(AES 124) and shel_write (AES 121) have automatically adapted themselves so to speak, they probably internaly call other changed Gemdos functions. If source file is a link, this one (the lnk file) will be deleted or renamed. Here I have wrote a all new routine which accesses the Windows routines. The link target is followed if necessary. So no links on links are created. This is the way Windows does it, and because MagicPC should follow the rules of Windows in itīs file system, I just did it in the same way. here only directory links are followed. Dcreate(57), Ddelete(58) und Dsetpath(59) If these return an EPTHNF error it will be tried to follow a link and then if necessary to call the function again. |