forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 upload => Topic started by: retrofit on September 06, 2006, 09:34:02 am

Title: Batch adding files from a location out side of the CPG album folder in windows
Post by: retrofit on September 06, 2006, 09:34:02 am
I needed to add and store files in a different location than the CPG album folder (such as D:\pictures instead of C:\pathtowebdocs\cpgallery\albums), but I quickly found that there was no support for this in CPG. I tried to create an NTFS Junction using winbolic link http://www.pearlmagik.com/winbolic/ (http://www.pearlmagik.com/winbolic/), but under Windows 2003 SBS the contents of the linked folder were not accessable due to "The filename, directory name, or volume lable syntax is incorrect". However, I tried winbolic link on Windows XP Pro and it apeared to work just fine. After hunting around for a cupple days I had almost decided that Windows 2003 just plain didn't support NTFS Junctions, and NTFS Junctions are looking more and more like the only way to do this.

Wikipedia to the rescue! Read about NTFS Junction point on wikipedia (http://en.wikipedia.org/wiki/NTFS_Junction_point)
BE SURE TO READ THE WARNING! hehe - (also one warning that is not very obvious in the warning is you DO NOT want to create a junction point to link to a parent folder... for example C:\Documents and Settings\user\Desktop\userfolder linked to C:\Documents and Settings\user creates a bottomless pit in the directory structure...)
Probably the most important info to get out of the warning is that whatever happens in/with the junction point folder happens in the targeted folder as well, and vice versa. If you set up a junction point to your already existing image repository, and then let CPG loose on it you could end up loosing some of your pictures. It's important to understand that CPG assumes it has full reign over the album folder. It creates different sized preview images of existing images, and more importantly if an image is deleted in CPG it also deletes the "origional image" as well.

With that said, wikipedia lead me to How to create and manipulate NTFS junction points (http://support.microsoft.com/?kbid=205524).
I used linkd.exe from Windows Server 2003 Resource Kit Tools (http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en) which also works on Windows XP. I'm not sure about Windows 2000... Maybe it comes with linkd.exe?

What I did was create a folder named webalbum in my main picture, and named the junction point folder in the CPG album folder webalbum(for example:linkd.exe "c:\pathtowebdocs\cpgallery\albums\webalbum" "d:\pictures\webalbum"). This way I copy images I want to put on CPG to the webalbum folder, and not worry about what CPG does to them.

Cheers