URL "binfile..." command seems to corrupt my mp3 files (re-creatable)
Jan Schenkel
janschenkel at yahoo.com
Sat Jan 10 00:44:04 EST 2009
--- Jim Schaubeck <jimschaubeck at yahoo.com> wrote:
> I have an interesting situation. The following
> simple script maintains mp3 file integrity (I can
> play it from both old and new folders)
>
> put URL "binfile:C:/Documents and Settings/Jim
> Schaubeck/Desktop/test1/testing.mp3" into URL
> "binfile:C:/Documents and Settings/Jim
> Schaubeck/Desktop/test2/testing.mp3" -- plays fine
> but I can not control filename.mp3
>
> However, the following script will copy the file but
> I can not play the newly created mp3 in folder test2
> (the mp3 file gets corrupted)
>
> put "testing.mp3" into tempvar
> put URL "binfile:C:/Documents and Settings/Jim
> Schaubeck/Desktop/test1/" & tempvar into URL
> "binfile:C:/Documents and Settings/Jim
> Schaubeck/Desktop/test2/testing.mp3"
>
> This script moves the file but the mp3 file gets
> corrupted.
> What am I missing? My end game is to have
> flexibility in changing mp3 file names and
> locations. The 'URL' keyword or 'rename' command
> both look like they can do what I want (almost)
>
> Jim...
>
It's a matter of operator priorities and
parenthesizing to get the desired behaviour. What you
wrote is the equivalent of:
##
put "testing.mp3" into tempvar
put (URL "binfile:C:/Documents and Settings/Jim
Schaubeck/Desktop/test1/") & tempvar into URL
"binfile:C:/Documents and Settings/Jim
Schaubeck/Desktop/test2/testing.mp3"
##
And what you want is:
##
put "testing.mp3" into tempvar
put URL ("binfile:C:/Documents and Settings/Jim
Schaubeck/Desktop/test1/" & tempvar) into URL
"binfile:C:/Documents and Settings/Jim
Schaubeck/Desktop/test2/testing.mp3"
##
Computers are very good at doing what we tell them to
do, not what we want them to do :-)
Jan Schenkel.
Quartam Reports & PDF Library for Revolution
<http://www.quartam.com>
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
More information about the use-livecode
mailing list