Get the current working directory

Hi,

How do i get the current working directory programmatically in coldfusion.

Actually , i have mapped a path using CFIDE such as C:\Inetpub\wwwroot\cfsamples

but how do i access that path in my code ? Urgent please help.


Thanx in advance

AWSNS.
awsnsAsked:
Who is Participating?
 
Tacobell777Connect With a Mentor Commented:
// Get root to this directory
request.pathRoot = getDirectoryFromPath(getCurrentTemplatePath());
0
 
kkhippleCommented:
have u had a look at
Performing file operations with cfftp
http://livedocs.macromedia.com/coldfusion/6/Developing_ColdFusion_MX_Applications_with_CFML/remoteServers6.htm

<!--- Get the current directory name. --->
<cfftp connection=Myftp
  action="GetCurrentDir"
  stoponerror="Yes">
0
 
pinaldaveCommented:
Hi awsns,
http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-pt9.htm#wp2459859
File management tools are listed there.

Regards,
---Pinal
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
awsnsAuthor Commented:
what do i give for the connection attribute
it is throwing an error for whatever i give

0
 
pinaldaveCommented:
Hi awsns,
<cfftp connection="Myftp"
  action="GetCurrentDir"
  stoponerror="Yes">

I think the double quotes are missing.
Regards,
---Pinal
0
 
jyokumConnect With a Mentor Commented:
if you want the directory of the template being executed.
<cfset currentDir=expandPath(".")>
0
 
Nathan Stanford SrSenior ProgrammerCommented:
Are you still needing help with this?  

Are you wanting the use CFFTP?  I would guess not?

Maybe I can help you if not...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.