Alias Behavior When Scripting...
Alias Behavior When Scripting...
- Subject: Alias Behavior When Scripting...
- From: Danny Arsenault <email@hidden>
- Date: Thu, 31 Jan 2002 08:25:03 -0500
I have a folder called "images" which contains about 30,000 product scans
for a website. (They are put into subfolders, but that main "images" folder
contains all the subfolders, and hence contains all the images.)
I develop my website in a test folder, which is a subdirectory of my
website's root directory, and because I was afraid of accidentally copying a
small folder of essential images from the test site and overwriting the
"real" images in the root folder, I decided not to have an "images" folder
in my test site at all.
Then I did a few manual tests and found that if I moved an alias folder with
the same exact name as the real thing into the folder with the real thing in
it, the alias would not overwrite the real thing. So I put an alias to the
"images" folder in my test directory.
Then I wrote a script so I could copy my test site over the live one when
I'd written and tested new parts of the site.
The script contains the following line...
duplicate every file of folder x to folder y with replacing
I figured this would be a good move since I add new files sometimes and
would not have to constantly update my script. The script goes on to
duplicate the essential folders over by name.
The first time I ran it the alias to the "images" folder overwrote the real
thing. Or so I thought, until I looked in the trash, and there was my
precious "images" folder, with all 30,000 images in it.
I suppose, now that I think of it, I could change the line to this...
duplicate every file of folder x whose name is not "images" to folder y with
replacing
But I am still curious about this behavior and wonder if anyone could shed
any light on it or point me towards the reference I need to understand it.
Thanks.
(Yes the folder is backed up, but it takes all day to copy it.)
Danny Arsenault
Webmaster
R & R Enterprises
toll free phone...800 937-3880
toll free fax........888 790-2437
international phone.....011-603-471-0808
international fax..........011-603-471-2844
http://www.rrauction.com