revCopyFile, revCopyFolder problems

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
exheusden
Posts: 170
Joined: Fri Oct 09, 2009 5:03 pm
Contact:

revCopyFile, revCopyFolder problems

Post by exheusden » Sat Dec 25, 2010 1:26 pm

I am unable to get either revCopyFile or revCopyFolder to work correctly.

revCopyFile copies nothing; revCopyFolder copies the folder, but not its contents.

I'll start with revCopyFils and maybe the solution to that will help with revCopyFolder, too.

Here is some test code:

Code: Select all

on mouseUp
   put fld "tester" into appleScriptInit
   
   put the effective filename of this stack into tPath
   set the itemDelimiter to slash
   delete last item of tPath
   put tPath & "/Required files/eBooks.css" into fileToCopy
   
   delete last item of tPath
   put tPath & "/" into folderToCopyTo
   
   revCopyFile fileToCopy, folderToCopyTo
   put "File:" && fileToCopy & "; Folder:" && folderToCopyTo
end mouseUp
The subfolder Required files and its associated files (in this case we are looking only at eBooks.css) exist. (Indeed, I can run a copy from the Terminal, but not from the Shell command).

The final put is there simply to check the variables being used.

The script compiles and runs without error. However, nothing is copied.

What am I doing wrong?

(RevMedia 4.0.0 under MacOS X 10.6.5)

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Re: revCopyFile, revCopyFolder problems

Post by WaltBrown » Mon Dec 27, 2010 8:02 am

You have two "delete last item of tPath " lines. Was that intentional, ie, you want the copied file in the parent directory of the directory your stack is in?
Walt
Walt Brown
Omnis traductor traditor

exheusden
Posts: 170
Joined: Fri Oct 09, 2009 5:03 pm
Contact:

Re: revCopyFile, revCopyFolder problems

Post by exheusden » Mon Dec 27, 2010 11:05 am

Yes, that was intentional.

RevCopyFile simply doesn't work in MacOS X, I've come to the conclusion.

I have solved my problem by using a simple Apple Script piece of code. See http://forums.runrev.com/phpBB2/viewtop ... 104#p29104

wsamples
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 264
Joined: Mon May 18, 2009 4:12 am

Re: revCopyFile, revCopyFolder problems

Post by wsamples » Tue Dec 28, 2010 6:55 pm

The conclusion that revCopyFile does not work in OS X is not supported by what I see here.

A one button application that runs a simple script with "answer file to copy", "answer destination directory" and "revCopyFile selectedfile,selectedDestination" works in both the IDE and as a standalone in 10.6.3. The standalone works in 10.6.3 whether the app is produced in OS X or in Linux.

A similar simple app which creates the destination directory instead of selecting an already existing one also works as expected.

An app made to select and then copy a file into [theApp.app]/Contents/MacOS directory of the standalone, using effective filename of this stack, etc. syntax, also successfully copies to this location for me.

With all due respect, is it not possible that you are having trouble with filepath names? Are the files and folders you're copying actually where you're telling the script to look, both working with the stack in the IDE and after you've made the standalone? Are all the various created pathnames correct; no extra slashes or misplaced quotes? Perhaps adding some mechanism to show the pathnames of all files and directories at each step of the operation, and whether or not the files to be copied are actually found in their specified locations at the time of the operation, would reveal such problems.

Post Reply