Skip to main content
September 14, 2007
Question

Creating an XML file with CFFILE on UNIX server

  • September 14, 2007
  • 3 replies
  • 532 views
I've run into a problem with creating an XML file on a UNIX server. I don't have access to the server and I'm trying to create an XML file so an outside agency can read it through the site URL.

On a Windows machine I use GetDirectoryFromPath and ExpandPath to return the drive/path info, then I create the file with this and the query result. On the Unix web server I am only being returned a relative path, because of this I can't write the XML file to the web server. Any idea how to get around this?

This topic has been closed for replies.

3 replies

BKBK
Community Expert
Community Expert
September 15, 2007
Knowing as little as I do about Unix I thought you still needed a drive "letter" to write the XML file to. I've been told I can get to the root but that it's root is "/bottomFolderName" (I was expecting R:\webRootPath\yourFolder\etc\XMLFileWrittenHere).

No, that is Windows thinking. You were told right. In Linux, a path usually begins with the forward slash /.

I had doubts about your code itself. Did you run your version of my example on Windows? If it works, then you will only have to replace the Windows path with something like the following. The rest of the code remains the same.





September 14, 2007
Knowing as little as I do about Unix I thought you still needed a drive "letter" to write the XML file to. I've been told I can get to the root but that it's root is "/bottomFolderName" (I was expecting R:\webRootPath\yourFolder\etc\XMLFileWrittenHere).

I will post the error I saw next week, it's low on the priority right now. I do know the code works great on Windows but failed on the actual Unix web server. I'm using CF 7.02 if it matters.
September 14, 2007
On Unix/Linux you don't have driveletters and absolute paths look like relative paths 'cause Unix/linux doesn't use \.
C:\folder\subfolder is on Unix/Linux /folder/subfolder. And very important "Foldername" is not "folderName" and Linux doesn't support spaces in Foldernames like Windows does. Hope this helps a bit.
BKBK
Community Expert
Community Expert
September 14, 2007
GetDirectoryFromPath and ExpandPath should work on Linux, too. Did you attempt something like the following?