Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm have a need to show the most up to date version of a certain file in a directory to users who access a folder on my site (lets call this folder logs). I can't just move the file into the folder as another process relies on being able to find and edit this file while it is running.

At first I had thought I could just create a folder on my site, give it the correct permissions and then create a symbolic link to the file. However it seems IIS7 does not follow symlinks.

Another solution would be to create a phpscript that pulls the correct file and displays it, but that felt like over-engineering the solution.

I know that on Apache this would be simple, but I can't figure out how to do it with IIS7.

To give an idea of the folder structure I'm working with. The directory looks like this.

Root
--File I need to serve.
--File containing plain text passwords.
--Other folders/files.

I can't move any of these files. If I just serve the entire directory using Virtual Directories in IIS I'll also be sharing files and folders containing configuration and other sensitive information.

share|improve this question
add comment

2 Answers

You can create a virtual folder in IIS that can point to an arbitrary location in your filesystem. The folder must have the correct permissions set for IIS to serve it, however.

share|improve this answer
    
It's important that I don't show the entire folder however. I have to show only a single file from a folder containing other files and folders. –  HarbingTarbl Sep 20 '12 at 1:02
add comment

IIS won't follow windows shortcuts (right click new shortcut) i'm guessing this is what your calling a symlink their not the same as a symlink in linux. IIS will follow both synlinks and junctions in a NTFS file system

windows NTFS file systems do have symlinks but they can only be created using (depending on os) linkd or mklink commands

junctions or hardlinks can me made using junction which is part of the sysinternals toolkit

share|improve this answer
    
I was actually using mklink from the command line to create the symlink. Neither a soft nor hard link worked, I ended up just using a php script to grab the right file. –  HarbingTarbl Oct 14 '12 at 19:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.