create an non-deletable symbolic link

W

William Gill

I develop websites and frequently need to have a "parallel" site when
making major changes. In the past I simply copied common asset
directories, but image directories are quite large. On my *nix systems I
could use symlinks to eliminate the duplication of these large files. I
am trying to use windows junctions but am running into a minor problem.
The junction source folder looks just like the target folder, so when
all changes are complete and there is no longer any need for the
duplicates it is easy to delete the junction thus deleting all files in
the target.

I have implemented the practice of changing the source icon to draw
attention to the fact it is not a regular folder, but it's still too
easy to do the damage. I have tried explicitly removing delete
permission, and it does not seem to help.

How can I protect the junction source from being deleted?

Any suggestions?
 
W

William Gill

philo said:
Get one of those USB sticks with the write-protect tab
and put the appropriatly reference link there...
then close the tab
Or I could reactivate one of my Linux boxes and move everything there,
but that doesn't answer my xp question either.
 
W

William Gill

philo said:
That DID answer your XP question!!!!!

Actually it didn't, it provided a hardware work-around.
That method will guarantee the link cannot be deleted.

So would burning them onto a CD but that too avoids the underlying
problem. Copying the original directory and not worrying about
junctions would provide an XP/NTFS solution. That way it would be OK to
delete the copy when I'm done. Of course I would have to insure any new
or changed images, scripts, and other assets get put in the copy and the
original folders so that the finished product is in fact the finished
product. Who cares that I have needless redundant copies, disk space is
cheap even if my time isn't. Silly me for trying to learn the OS
mechanics to provide an actual solution.
Of course you may want to do a little research into "ownership"
and remove privileges from all but the owner ...similar to the way
Linux would do it...but I somehow thought you had tried that already

I have been researching NTFS ACL's , and have tried changing various
permissions, but obviously I'm missing something, which in my book is
usually a good time to ask for help. In Linux I could remove a symbolic
link with a simple 'rm' command or an 'unlink' command, and not delete
the files in the target. That's not what happens with an NTFS junction
so I'm trying to learn the correct method. Sorry if that upsets you.
It's too bad XP doesn't issue an error if you try to 'delete' instead of
'linkd', or better still translate a 'delete' on a junction to the
appropriate 'linkd' command.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top