copy a image/binary file on a mac

Klaus Major k_major at osnabrueck.netsurf.de
Sat Jan 19 14:27:01 EST 2002


Hi Yves,

> Hello,
>
>>
>> function ye_olde_filetype el_patho
>>   put the directory into old_dir
>> ##always a good idea to save and restore the original directory !
>> ##a MUST if you work with relative paths for images etc...
>>
>>   set the itemdel to "/"
>>   put last item of el_patho into the_file
>> ##the filename
>>
>>   delete last item of el_patho
>>   set the directory to el_patho
>> ##now we are in the folder where the file resides
>>
>>   put the long files into all_files
>> ##take a look in the reference about "the long files"
>> ##that returns a list with lots of infos about the content of a folder
>> ##(divided by a comma)
>> ##like the filename, date of last modification, last saved ...
>> ##and the filetype as the last item of each line
>>
>>   get line(lineoffset(the_file, all_files)) of all_files
>> ##now we extract that line containing the filename
>>
>>   set the itemdel to ","
>> ##restore the old itemdel. very important
>>   set the directory to old_dir
>> ##restore the old directory
>>
>>   return last item of it
>> ##that's it
>> end ye_olde_filetype
>>
>>
>> Hope that helps.
>>
>> Have a nice weekend.
>>
>>
>> Best from rainy germany
>>

>>
>
>
>
> The function ye_olde_filetype doesn't work.
> But your explication is correct.
> So I write :
>
> set the fileType to "8BIMJPEG" BEFORE copying the image and it works 
> fine.
>
> The problem comes from the fact that your funciton doesn't return a 
> filetype.
> it only returns empty !
>

Funny thing.

It works for me here on my mac... ?!

I always test my scripts before posting ;-)

Regards

Klaus Major
k_major at osnabrueck.netsurf.de

> So if you can ameliorate your function, it will be possible to copy 
> justŠanythingŠ
> -- Greetings.
>


Wow, i do not have a dictionary at hand. What does that mean: 
ameliorate ?

Wait, since i had latin at school, melior means better ;-)

So if i could make my script better...

See above...


???




More information about the use-livecode mailing list