Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!inesc!unl!unl!jpc From: jpc@fctunl.rccn.pt (Jose Pina Coelho) Newsgroups: comp.sys.ibm.pc Subject: Re: 'link'ing a la U*IX in DOS Message-ID: Date: 4 Jun 90 13:49:26 GMT References: <1990Jun1.193543.13903@ccu.umanitoba.ca> Sender: news@fctunl.rccn.pt (USENET News System) Organization: Universidade Nova de Lisboa -- Lisbon, Portugal Lines: 46 In-Reply-To: umhudso7@ccu.umanitoba.ca's message of 1 Jun 90 19:35:43 GMT Well... A few months ago I was making a program that was supposed to work like simbolic/hard links. It was a TSR that caught the INT 21, it only processed the handle calls and rename/remove Physicaly both hard and simbolic links consist of a file with the name of the 'true' file (which could be another link). They started with a magic number "#@#$SOFTLINK$" or "#@#$HARDLINK$", and were followed by the filename. When you made an open, the new routine would open the file, and if it started with a magic number it would call itself with the new name. there was a database C:\UNIX\LINKS which said which files had hard links C:\TC\TURBOC.CFG 20 <- There are 20 hard links to TURBOC.CFG If you try to erase a symbolic link, you erase it. Final! If you try to erase a hard link, the program find out the real file and decreases it's reference count. If you try to erase a file that is in the database, the program will: 1 - Erase it, and hell with dangling hard links 2 - Say: 'There are hard links' and do nothing 3 - Move the file to one of the hard links, and scan the disk changing every hard-link to that file to the new file 1 - Is just like a symbolic link 2 - Is the easyest 3 - Is the HARD (only?) way. Why didn't I post? - I need a few more hundred hours of idle creative time. - Currently, the only thing it does is CRASH. - All the comments are in BAD portuguese. -- Jose Pina Coelho | BITNET/Internet: jpc@fctunl.rccn.pt Rua Jau N 1, 2 Dto | UUCP: jpc@unl.uucp 1300 Lisboa, PORTUGAL | ARPA: jpc%hara.fctunl.rccn.pt@mitvma.mit.edu Home phone: (+351) (1) 640767 - If all men were brothers, would you let one marry your sister ?