2

So I have the the current directory structure

/dir1 ---
    /(sym_link) <----
    file1.txt       |
    file2.txt       |
                    |
/dir2               |
    /(sym_link)<----|
    file3.txt       |
    file4.txt       |
                    |
/sym_link ----------|
   sym_file1.txt
   sym_file2.txt

I have been investigating using <cffile> and <cfdirectory> to try generate a symbolic link on a Solaris Server ( There doesn't seem to be any documentation about working with symbolic links on these tags.. or really in general)

I am aware I can run a script on the server and generate them external of ColdFusion with <cfexecute> like here

Curious I manually created a Symbolic Link in /dir1 and did the following command

<cfdirectory action="list" directory="/dir1" recurse="false" name="myList">
<cfdump var="#myList#">

and recieved

Attributes      DateLastModified      Directory Link    Mode        Name    Size Type
[empty string]  10/16/2018 09:38:53 PM  /dir1  YES  [empty string]  sym_link  2  Dir
[empty string]  10/17/2018 03:16:38 PM  /dir1  NO   [empty string]  file1.txt 0  File
[empty string]  10/17/2018 03:16:41 PM  /dir1  NO   [empty string]  file2.txt 0  File

I can see that ColdFusion recognizes it as a symbolic link!

However there doesn't seem to be any way to create a DIR with Link set to YES using <cfdirectory action="create">

(One approach I have been attempting to copy an existing symbolic link to where I need it, but haven't had much luck yet)

Is there anyway to create a symbolic link using ONLY ColdFusion and not running any scripts locally on the server?

Hedge7707
  • 557
  • 1
  • 5
  • 17
  • The answer at the bottom of this seems similar to your concern: https://stackoverflow.com/questions/6435175/coldfusion-9-tomcat-7-apache-and-vhosts/16555822#16555822 – James A Mohler Oct 17 '18 at 17:20
  • 2
    It believe its a tad different in nature.... The answer at the bottom of the linked post describes an approach of using symlinks (created manually) to avoid duplicating WEB-INF when using two Apache vhosts ... I'm asking about actually creating the symbolic links from within ColdFusion as opposed to just following them ... Thanks for the suggestion tho! – Hedge7707 Oct 17 '18 at 17:36
  • 1
    I don't know if CF supports it. If not, might try using java [Files.createSymbolicLink(Path, Path)](https://stackoverflow.com/a/19543891/8895292). See also [Links, Symbolic and Otherwise](https://docs.oracle.com/javase/tutorial/essential/io/links.html). – SOS Oct 17 '18 at 18:56
  • 1
    I don't think CF supports it either. While searching for it I came across this blog post from Ben Nadel explaining that you need to configure Tomcat for ColdFusion to even use a symbolic link. Maybe it will help you but I'm guessing not. [ColdFusion 10 Beta, Apache Tomcat, And Symbolic Links On Mac OSX](https://www.bennadel.com/blog/2330-coldfusion-10-beta-apache-tomcat-and-symbolic-links-on-mac-osx.htm) – Miguel-F Oct 17 '18 at 19:13

0 Answers0