I currently have a program that will search through a given directory and will collect all the sub-directories (folders) and their timestamps. I use this to see if any folders have been added/changed/deleted. It works beautifly, except it doesn't work for a folder that is actually a shortcut to another folder.
I was looking at Detecting if a folder is a symbolic link and thought maybe the -l (symbolic link) check might work for this, but it doesn't. I want to do some kind of check to see if it is a shortcut or not.
Another idea I had to solve this is to somehow identify the type of file it is, but I am having a hard time finding how to do this as well.
This is what my code looks like right now.
With this code, the shortcut folders say that the directory does not exist. I want to make another section so my code does something like this:if (-d $directory) { #continue processing } else { print "$directory does not exist"; }
Any ideas what that SOMETHING could be?if (-d $directory) { #continue processing } elsif (SOMETHING) #if it is a shortcut { print "$directory is a shortcut. Will not process."; } else { print "$directory does not exist"; }
I am using Windows OS.
In reply to Determining if folder is a shortcut by atyrrell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |