Long FileName Grief: need work around!

Sivakatirswami katir at hindu.org
Sat Jul 1 05:41:15 EDT 2006


Ok the problem of long file  names on the Mac not working in  
Revolution continues to "bite me" at every turn... Here's the latest.

I am processing some text files by dragging them onto a button in a  
mini data base (rev stack with about 1200 card... not  big...) that  
loads the text file into a field, Then my script renames the file to  
another folder.

The problem is the  renamed filename is hashed if it is too long. Any  
work arounds?

Did anyone do any begging  at  RevCon  West to solve  this  bug?  
(it's been on BugZilla for literally 3-4 years....)


--> all handlers

on dragEnter
   set the acceptDrop to true
  end dragEnter

on dragDrop
   put  dragData["files"] into tPath
   put url ("file:/"& tPath) into fld "transcript"
    set the itemdel to "/"
   put item -1 of tPath into tFileName

   rename file tPath to ("/users/katir/desktop/audio transcripts/ 
loaded to dBase-not on web yet/" & tFileName)

end dragDrop

Original File name  will be something like:

January071999_Personal_Testimony_of_trip_to_Mount_Kailash-Himalayas.txt

And renamed  file  becomes, max 32 chars:

January071999_PersonC#1FFA28.txt  ouch! :-) there's no recovery...  
fortunately I only tried  one... and will test on copies in the future.

There's probably a work around but I don't  know what it would be.  I  
tried the  shell command "mv" from terminal and it works, but when  
transposed to a script it  fails: well, it  moves  and renames the  
file, but the file name  is hashed again.

put "mv " & quote & tPath & quote && quote & "/users/katir/desktop/ 
taka-audio transcripts/loaded to dBase but not on TAKA/" & tFileName  
& quote into tCmd
get shell (tCmd)
# this same cmd will work from the terminal
# and preserve  the long file name, why not here?
put the result


TIA

Sivakatirswami







More information about the use-livecode mailing list