SOT: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Dick Applebaum
Is it possible to create a file system link or symlink with CFMX/Java?

TIA

Dick

Frisbeetarianism is the belief that when you
die, your soul goes up on the roof and gets stuck.
- George Carlin -
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Dave Watts
 Is it possible to create a file system link or symlink with CFMX/Java?

I don't know if there's some Java-specific way to do this, but I'm pretty
sure you can do it with CFEXECUTE and your system's command-line interface
for creating symbolic links.

Dave Watts, CTO, Fig Leaf Software 
http://www.figleaf.com/ 
phone: 202-797-5496 
fax: 202-797-5444
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Nick de Voil
  Is it possible to create a file system link or symlink with CFMX/Java?

The built-in java.io package doesn't provide any way to do this, because
it's a 'nix-specific thing.

Can be done in Perl though.

Nick
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Joe Eugene
Are you trying to access your files across a Network or Remote Server?
Yes, we have implemented some Java Classes to accomplish this

I.E. File Copy/Delete etc across the Network.

Joe

- Original Message - 
From: Dick Applebaum [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Tuesday, June 29, 2004 12:04 PM
Subject: SOT: Create Links Symlinks with CFMX/Java

 Is it possible to create a file system link or symlink with CFMX/Java?

 TIA

 Dick

 Frisbeetarianism is the belief that when you
 die, your soul goes up on the roof and gets stuck.
 - George Carlin -



 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Dick Applebaum
kind of a long story ...

I have lots of files buried in the file structure of the OS (Mac OS X).

They consist of audio tracks, images and movies.

All of these (and the file structure) are maintained by Apple-supplied 
iLife programs (iTunes, iPhoto, iMovie, etc.)

The file names/directory names can contain any valid characters except 
colon;

This naming flexibility gives CFFile fits -- especially names that 
contain an ampersand ()

I don't want to interfere with directory structure, I just want to 
provide an alternate,CF-acceptable path to the files.

PHP provides a native capability (non-windows) to create links and 
symlinks -- I am surprised that Java doesn't have the equivalent.

BTW, doesn't windows provide a Alias or pseudo-file capability -- 
like those little things on the desktop that represent an application 
contained elsewhere in the file system.

TIA

Dick

On Jun 29, 2004, at 9:38 AM, Joe Eugene wrote:

 Are you trying to access your files across a Network or Remote Server?
Yes, we have implemented some Java Classes to accomplish this

I.E. File Copy/Delete etc across the Network.

Joe

- Original Message -
From: Dick Applebaum [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Tuesday, June 29, 2004 12:04 PM
Subject: SOT: Create Links Symlinks with CFMX/Java

 Is it possible to create a file system link or symlink with 
 CFMX/Java?

 TIA

 Dick

 Frisbeetarianism is the belief that when you
 die, your soul goes up on the roof and gets stuck.
 - George Carlin -




 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Dave Watts
 BTW, doesn't windows provide a Alias or pseudo-file capability -- 
 like those little things on the desktop that represent an application 
 contained elsewhere in the file system.

Those are called shortcuts, and they're not really the same as a symbolic
link. They're simply files that contain information about other files, and
when the user interacts with them in certain ways, they trigger some action
(typically, the execution of some program).

Within NTFS, you can actually create symbolic links to directories, but not
to files.

Dave Watts, CTO, Fig Leaf Software 
http://www.figleaf.com/ 
phone: 202-797-5496 
fax: 202-797-5444
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Dick Applebaum
On Jun 29, 2004, at 10:27 AM, Dave Watts wrote:

  BTW, doesn't windows provide a Alias or pseudo-file capability --
 like those little things on the desktop that represent an 
 application
 contained elsewhere in the file system.

Those are called shortcuts, and they're not really the same as a 
 symbolic
link. They're simply files that contain information about other 
 files, and
when the user interacts with them in certain ways, they trigger some 
 action
(typically, the execution of some program).

Within NTFS, you can actually create symbolic links to directories, 
 but not
to files.


OK!

Can these file/directory names contain characters like , smart quotes 
-- any thing that could be found in song titles, etc.

If so, can CFMX file access these files on windows (and not on 'Nix).

TIA

Dick

Frisbeetarianism is the belief that when you
die, your soul goes up on the roof and gets stuck.
- George Carlin -
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Dave Watts
 Can these file/directory names contain characters like , smart quotes
 -- any thing that could be found in song titles, etc.

Almost anything:

http://msdn.microsoft.com/library/default.asp?url="">
/naming_a_file.asp

http://blogs.msdn.com/brian_dewey/archive/2004/01/19/60263.aspx

 If so, can CFMX file access these files on windows (and not on 'Nix).

Honestly, I don't know. I would assume so, although how to do so may not be
immediately obvious. That is, you may have to escape characters in your
CFFILE tag, or something like that.

Dave Watts, CTO, Fig Leaf Software 
http://www.figleaf.com/ 
phone: 202-797-5496 
fax: 202-797-5444
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Mark Drew
I am not sure if this would work (as I am not sure what precicely you
are trying to achieve) but would CF mappings help in this case?

On Tue, 29 Jun 2004 13:55:58 -0400, Dave Watts [EMAIL PROTECTED] wrote:
 
  Can these file/directory names contain characters like , smart quotes
  -- any thing that could be found in song titles, etc.
 
 Almost anything:
 
 http://msdn.microsoft.com/library/default.asp?url="">
 /naming_a_file.asp
 
 http://blogs.msdn.com/brian_dewey/archive/2004/01/19/60263.aspx
 
  If so, can CFMX file access these files on windows (and not on 'Nix).
 
 Honestly, I don't know. I would assume so, although how to do so may not be
 immediately obvious. That is, you may have to escape characters in your
 CFFILE tag, or something like that.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 phone: 202-797-5496
 fax: 202-797-5444
 
 

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Perez, Percy
I remember CYGWIN from redhat included ln.You can use it to create
links.I think it worked for files as well as directories.

 
Percy

_

From: Mark Drew [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 29, 2004 3:56 PM
To: CF-Talk
Subject: Re: Create Links Symlinks with CFMX/Java

I am not sure if this would work (as I am not sure what precicely you
are trying to achieve) but would CF mappings help in this case?

On Tue, 29 Jun 2004 13:55:58 -0400, Dave Watts [EMAIL PROTECTED] wrote:
 
  Can these file/directory names contain characters like , smart quotes
  -- any thing that could be found in song titles, etc.
 
 Almost anything:
 

http://msdn.microsoft.com/library/default.asp?url="">
 /naming_a_file.asp
 
 http://blogs.msdn.com/brian_dewey/archive/2004/01/19/60263.aspx
 
  If so, can CFMX file access these files on windows (and not on 'Nix).
 
 Honestly, I don't know. I would assume so, although how to do so may not
be
 immediately obvious. That is, you may have to escape characters in your
 CFFILE tag, or something like that.
 
 Dave Watts, CTO, Fig Leaf Software
 http://www.figleaf.com/
 phone: 202-797-5496
 fax: 202-797-5444
 
 
 
_
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Dick Applebaum
On Jun 29, 2004, at 12:56 PM, Mark Drew wrote:

 I am not sure if this would work (as I am not sure what precicely you
are trying to achieve) but would CF mappings help in this case?

I don't think mappings are the answer.

Here's an example of the specific problem -- I want to serve an .mp3 
(could be a .mov) file from Apples iTunes directory sub-structure which 
might look as follows:

--artist
album
---track (song) name

or

--Willie Nelson  Ray Charles
unKnown Album
--Seven Spanish Angels.mp3

AFAIK, these fields can contain any valid character except colon (:)

Now, I get the path to the tracks by parsing an XML file which yields a 
path:

/iTunes Music/Willie Nelson  Ray Charles/unKnown Album/Seven 
Spanish Angels.mp3

If I try to serve this with CFContent :

	 cfcontent type = audio/mp3
	 file=#FilePath#
	 deleteFile = No

CFMX can't find the file -- it barfs on the  -- and I don't know how 
to escape it

I suppose I could use a mapping and cflocation, but that exposes my 
file/directory structure.

Dick

In times like these, it helps to recall that
there have always been times like these.
- Paul Harvey -
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Barney Boisvert
Can you create a java.io.File object with the path, and get any attributes
(like it's size)?What does getCanonicalPath() return?

You on windows, or your Mac?If you're on windows, you could manually
conver the directories to the progra~1 style, and then use that.

Cheers,
barneyb

 -Original Message-
 From: Dick Applebaum [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, June 29, 2004 5:19 PM
 To: CF-Talk
 Subject: Re: Create Links Symlinks with CFMX/Java
 
 On Jun 29, 2004, at 12:56 PM, Mark Drew wrote:
 
  I am not sure if this would work (as I am not sure what 
 precicely you
 are trying to achieve) but would CF mappings help in this case?
 
 I don't think mappings are the answer.
 
 Here's an example of the specific problem -- I want to serve an .mp3 
 (could be a .mov) file from Apples iTunes directory 
 sub-structure which 
 might look as follows:
 
 --artist
 album
 ---track (song) name
 
 or
 
 --Willie Nelson  Ray Charles
 unKnown Album
 --Seven Spanish Angels.mp3
 
 AFAIK, these fields can contain any valid character except colon (:)
 
 Now, I get the path to the tracks by parsing an XML file 
 which yields a 
 path:
 
 /iTunes Music/Willie Nelson  Ray Charles/unKnown Album/Seven 
 Spanish Angels.mp3
 
 If I try to serve this with CFContent :
 
 	 cfcontent type = audio/mp3
 	 file=#FilePath#
 	 deleteFile = No
 
 CFMX can't find the file -- it barfs on the  -- and I don't know how 
 to escape it
 
 I suppose I could use a mapping and cflocation, but that exposes my 
 file/directory structure.
 
 Dick
 
 In times like these, it helps to recall that
 there have always been times like these.
 - Paul Harvey -
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Jordan Michaels
Would it be possible for you to do a Replace function on the path before 
you pass it on to the tag? Just replace the one ampersand with two of 
them and CF should interpret it correctly.

Just an idea...

-- 
Warm regards,
Jordan Michaels
Vivio Technologies
http://www.viviotech.net/
[EMAIL PROTECTED] 

Dick Applebaum wrote:

 On Jun 29, 2004, at 12:56 PM, Mark Drew wrote:

  I am not sure if this would work (as I am not sure what precicely you
 are trying to achieve) but would CF mappings help in this case?

 I don't think mappings are the answer.

 Here's an example of the specific problem -- I want to serve an .mp3
 (could be a .mov) file from Apples iTunes directory sub-structure which
 might look as follows:

 --artist
 album
 ---track (song) name

 or

 --Willie Nelson  Ray Charles
 unKnown Album
 --Seven Spanish Angels.mp3

 AFAIK, these fields can contain any valid character except colon (:)

 Now, I get the path to the tracks by parsing an XML file which yields a
 path:

 /iTunes Music/Willie Nelson  Ray Charles/unKnown Album/Seven
 Spanish Angels.mp3

 If I try to serve this with CFContent :

 cfcontent type = audio/mp3
 file=#FilePath#
 deleteFile = No

 CFMX can't find the file -- it barfs on the  -- and I don't know how
 to escape it

 I suppose I could use a mapping and cflocation, but that exposes my
 file/directory structure.

 Dick

 In times like these, it helps to recall that
 there have always been times like these.
 - Paul Harvey -

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Dick Applebaum
I actually tried escaping the ampersand with:

2 ampersands
\

neither works.

Dick
On Jun 29, 2004, at 5:32 PM, Jordan Michaels wrote:

 Would it be possible for you to do a Replace function on the path 
 before
you pass it on to the tag? Just replace the one ampersand with two of
them and CF should interpret it correctly.

Just an idea...

--
Warm regards,
Jordan Michaels
Vivio Technologies
http://www.viviotech.net/
[EMAIL PROTECTED]

Dick Applebaum wrote:

 On Jun 29, 2004, at 12:56 PM, Mark Drew wrote:

  I am not sure if this would work (as I am not sure what precicely 
 you
   are trying to achieve) but would CF mappings help in this case?

 I don't think mappings are the answer.

 Here's an example of the specific problem -- I want to serve an .mp3
 (could be a .mov) file from Apples iTunes directory sub-structure 
 which
 might look as follows:

 --artist
 album
 ---track (song) name

 or

 --Willie Nelson  Ray Charles
 unKnown Album
 --Seven Spanish Angels.mp3

 AFAIK, these fields can contain any valid character except colon (:)

 Now, I get the path to the tracks by parsing an XML file which 
 yields a
 path:

 /iTunes Music/Willie Nelson  Ray Charles/unKnown Album/Seven
 Spanish Angels.mp3

 If I try to serve this with CFContent :

 cfcontent type = audio/mp3
 file=#FilePath#
 deleteFile = No

 CFMX can't find the file -- it barfs on the  -- and I don't know 
 how
 to escape it

 I suppose I could use a mapping and cflocation, but that exposes my
 file/directory structure.

 Dick

 In times like these, it helps to recall that
 there have always been times like these.
 - Paul Harvey -


 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Dick Applebaum
I am on the Mac -- but I want the app to run on windows, too.

I will need to do some reading  fillding to try the Java suggestions, 
but I will.

IF I can find/access the file with Java, then I guess I will need to 
read it into a variable so I can serve it with cfcontent.

I'd rather just cfcontent the file, but this would be acceptable.

Dick

leaning towards learning Java -- then I'll really be dangerous!

On Jun 29, 2004, at 5:29 PM, Barney Boisvert wrote:

 Can you create a java.io.File object with the path, and get any 
 attributes
(like it's size)?  What does getCanonicalPath() return?

You on windows, or your Mac?  If you're on windows, you could manually
conver the directories to the progra~1 style, and then use that.

Cheers,
barneyb

 -Original Message-
 From: Dick Applebaum [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 29, 2004 5:19 PM
 To: CF-Talk
 Subject: Re: Create Links Symlinks with CFMX/Java

 On Jun 29, 2004, at 12:56 PM, Mark Drew wrote:

  I am not sure if this would work (as I am not sure what
 precicely you
   are trying to achieve) but would CF mappings help in this case?

 I don't think mappings are the answer.

 Here's an example of the specific problem -- I want to serve an .mp3
 (could be a .mov) file from Apples iTunes directory
 sub-structure which
 might look as follows:

 --artist
 album
 ---track (song) name

 or

 --Willie Nelson  Ray Charles
 unKnown Album
 --Seven Spanish Angels.mp3

 AFAIK, these fields can contain any valid character except colon (:)

 Now, I get the path to the tracks by parsing an XML file
 which yields a
 path:

 /iTunes Music/Willie Nelson  Ray Charles/unKnown Album/Seven
 Spanish Angels.mp3

 If I try to serve this with CFContent :

 cfcontent type = audio/mp3
 file=#FilePath#
 deleteFile = No

 CFMX can't find the file -- it barfs on the  -- and I don't know 
 how
 to escape it

 I suppose I could use a mapping and cflocation, but that exposes my
 file/directory structure.

 Dick

 In times like these, it helps to recall that
 there have always been times like these.
 - Paul Harvey -

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Jordan Michaels
Interesting. Mind if I ask what went wrong? Was it passing an incorrect 
path or was the path not being interpreted correctly?

Warm regards,
Jordan

Dick Applebaum wrote:

 I actually tried escaping the ampersand with:

 2 ampersands
 \

 neither works.

 Dick
 On Jun 29, 2004, at 5:32 PM, Jordan Michaels wrote:

  Would it be possible for you to do a Replace function on the path
  before
 you pass it on to the tag? Just replace the one ampersand with two of
 them and CF should interpret it correctly.
 
 Just an idea...
 
 --
 Warm regards,
 Jordan Michaels
 Vivio Technologies
 http://www.viviotech.net/
 [EMAIL PROTECTED]
 
 Dick Applebaum wrote:
 
  On Jun 29, 2004, at 12:56 PM, Mark Drew wrote:
 
   I am not sure if this would work (as I am not sure what precicely
  you
  are trying to achieve) but would CF mappings help in this case?
 
  I don't think mappings are the answer.
 
  Here's an example of the specific problem -- I want to serve an .mp3
  (could be a .mov) file from Apples iTunes directory sub-structure
  which
  might look as follows:
 
  --artist
  album
  ---track (song) name
 
  or
 
  --Willie Nelson  Ray Charles
  unKnown Album
  --Seven Spanish Angels.mp3
 
  AFAIK, these fields can contain any valid character except colon (:)
 
  Now, I get the path to the tracks by parsing an XML file which
  yields a
  path:
 
  /iTunes Music/Willie Nelson  Ray Charles/unKnown Album/Seven
  Spanish Angels.mp3
 
  If I try to serve this with CFContent :
 
  cfcontent type = audio/mp3
  file=#FilePath#
  deleteFile = No
 
  CFMX can't find the file -- it barfs on the  -- and I don't know
  how
  to escape it
 
  I suppose I could use a mapping and cflocation, but that exposes my
  file/directory structure.
 
  Dick
 
  In times like these, it helps to recall that
  there have always been times like these.
  - Paul Harvey -
 
 

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: Create Links Symlinks with CFMX/Java

2004-06-29 Thread Dick Applebaum
Nothing happened

So I added a File Exists test (entire code below)

Then tried escaping the 

BTW, CFContent could not resolve a manually created symlink --- 
interesting

Dick

cfsetting enablecfoutputonly=yes /

cfoutputbr#Application.Tracks[URL.TID][Location]#/cfoutput

!--- Decode the Location URL so we can use it as a file path ---
cfset Location = Application.Tracks[URL.TID][Location] /
cfset FilePath = URLDecode(ReReplace(Location, file://localhost, 
)) /
!---
cfset FilePath = ReReplace(FilePath, /Users/test/Music/iTunes/iTunes 
Music, iTunes Music alias) /
---

!--- Get the file extension ---
cfset FileType = ReReplace(FilePath, .*(\..*$), \1) /

cfoutputbr#FilePath#/cfoutput
cfoutputbr#FileType#/cfoutput

!--- Abort if we can't find the file ---
cfif NOT FileExists((FilePath)) 
cfabort
/cfif

!--- Serve content based on File Type ---
cfif FileType EQ .mov 

	!--- This works for QT .mov files ---
	CFHEADER NAME=Content-Disposition VALUE=attachment; 
filename=movie.mov
	
	 cfcontent type = video/quicktime
	 file=#FilePath#
	 deleteFile = No

cfelse

	!--- this works for mp3 ---
	CFHEADER NAME=Content-Disposition
	VALUE=attachment; filename=song.mp3
	
	 cfcontent type = audio/mp3
	 file=#FilePath#
	 deleteFile = No

/cfif

On Jun 29, 2004, at 6:22 PM, Jordan Michaels wrote:

 Interesting. Mind if I ask what went wrong? Was it passing an incorrect
path or was the path not being interpreted correctly?

Warm regards,
Jordan

Dick Applebaum wrote:

 I actually tried escaping the ampersand with:

 2 ampersands
 \

 neither works.

 Dick
 On Jun 29, 2004, at 5:32 PM, Jordan Michaels wrote:

  Would it be possible for you to do a Replace function on the path
  before
   you pass it on to the tag? Just replace the one ampersand with 
 two of
   them and CF should interpret it correctly.
 
   Just an idea...
 
   --
   Warm regards,
   Jordan Michaels
   Vivio Technologies
   http://www.viviotech.net/
 [EMAIL PROTECTED]
 
   Dick Applebaum wrote:
 
    On Jun 29, 2004, at 12:56 PM, Mark Drew wrote:
   
     I am not sure if this would work (as I am not sure what 
 precicely
  you
      are trying to achieve) but would CF mappings help in this 
 case?
   
    I don't think mappings are the answer.
   
    Here's an example of the specific problem -- I want to serve 
 an .mp3
    (could be a .mov) file from Apples iTunes directory 
 sub-structure
  which
    might look as follows:
   
    --artist
    album
    ---track (song) name
   
    or
   
    --Willie Nelson  Ray Charles
    unKnown Album
    --Seven Spanish Angels.mp3
   
    AFAIK, these fields can contain any valid character except 
 colon (:)
   
    Now, I get the path to the tracks by parsing an XML file which
  yields a
    path:
   
    /iTunes Music/Willie Nelson  Ray Charles/unKnown 
 Album/Seven
    Spanish Angels.mp3
   
    If I try to serve this with CFContent :
   
    cfcontent type = audio/mp3
    file=#FilePath#
    deleteFile = No
   
    CFMX can't find the file -- it barfs on the  -- and I don't 
 know
  how
    to escape it
   
    I suppose I could use a mapping and cflocation, but that 
 exposes my
    file/directory structure.
   
    Dick
   
    In times like these, it helps to recall that
    there have always been times like these.
    - Paul Harvey -
   
 


 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]