Boost logo

Boost :

From: Victor A. Wagner, Jr. (vawjr_at_[hidden])
Date: 2003-11-25 19:19:27


If you get offended easily you might want to skip my comments

You know, most people simply want to be able to say.... "When I use this
'name', in this directory, I want it to behave like it's really "some name
in some (other) place". They don't give a <insert favorite expletive here>
how it's done, whether it's a hard-link, soft-link, symbolic-link, they
"just want it done". That is, they want a synonym for something else.

I really think a HUGE problem that we in the C (to start) and now the C++
community has is that there are too many people who think first, foremost,
and always of "how is this implemented" when they look at some syntax.
We have nonsense in the language (the first example that pops to mind, I
could go on for hours on this topic) that prohibits using "switch
(somearbitrarystring)..." because _some_ people seem to insist that "a
switch implies using a jump table". Which is patently <insert 2nd favorite
expletive here> since all the compilers I've worked on create the
equivalent of if()... else if() ... else if()... if the jump table would be
very sparse.

I believe we have exactly the same situation here. We're worried about the
exact semantics of how *nix does things (about which _I_ couldn't give a
flying <insert 3rd favorite expletive here>). I really don't. I want the
ability to say to the filesystem: "in the future when someone says
"blahblah" you should instead refer to "halbhalb" ". And it shouldn't
matter whether I'm talking files or directories or volumes or whatever.
I don't care if we use hardlinks, softlinks, reparsepoints, or what. It
would be NICE (very nice) if after we do this, the OS believed the alias as
well, and that other programs attempting to use files and directories would
accept our fictions as reality also.
</comments>
At Tuesday 2003-11-25 12:32, you wrote:
>"Bronek Kozicki" <brok_at_[hidden]> writes:
>
> > Victor A. Wagner, Jr. <vawjr_at_[hidden]> wrote:
> >> There _is_ a mechanism for creating hard links to directories on
> >> NTFS. I don't know what the relevant runtime calls are, but I have a
> >> utility that creates them. When you do a dir on a directory which
>
> > the same mechanism can be used to create hard links to files on NTFS.
> > This mechanism is called "reparse points". You can create hard links
> > with DeviceIoControl (Win32 Storage API) function called with control
> > code FSCTL_SET_REPARSE_POINT. Another code FSCTL_GET_REPARSE_POINT can
> > be used to query for hard links. It's documented here:
>
> >
> http://msdn.microsoft.com/library/en-us/fileio/base/hard_links_and_junctions.asp
> > http://msdn.microsoft.com/library/en-us/fileio/base/reparse_points.asp
> >
> http://msdn.microsoft.com/library/en-us/fileio/base/file_systems_control_codes.asp
>
> > Simple utility for managing junctions (directory hard links) is
> > available here, with source:
> > http://www.sysinternals.com/ntw2k/source/misc.shtml#junction
>
>AFAIK, junctions are not like POSIX hard links because they do not
>involve a reference count, and can refer to directories on other
>filesystems. Thus, they are like (absolute-path) symbolic links. The
>real question, I suppose, is whether NTFS supports these "junctions" or
>symbolic links to files in addition to directories. I am guessing the
>answer in no, and in any case the filesystem library could simply throw
>an exception if the user attempted to create a file symbolic link on
>NTFS.
>
>(Note that the hard links created by CreateHardLink and BackupWrite
>_are_ like POSIX hard links, but these can only be used on files, not
>directories.)
>
>
>--
>Jeremy Maitin-Shepard
>_______________________________________________
>Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Victor A. Wagner Jr. http://rudbek.com
The five most dangerous words in the English language:
               "There oughta be a law"


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk