revCopyFolder Issue
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
revCopyFolder Issue
revCopyFolder "\\server\programpath\programfolder", "C:/Programfolder"
works great if "C:/Programfolder" doesnt exist
if it does exist then it still works but it puts the copied folders here:
"C:/ProgramFolder/server/programpath/programfolder/"
Help?
works great if "C:/Programfolder" doesnt exist
if it does exist then it still works but it puts the copied folders here:
"C:/ProgramFolder/server/programpath/programfolder/"
Help?
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: revCopyFolder Issue
What happens when you use a full path for the source folder as you do for the destination folder?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: revCopyFolder Issue
Im not sure I understand what you mean, as far as I know that is the full path to the files to be copied.
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: revCopyFolder Issue
Run this in the message box, selecting the source folder when prompted, and post the result here:
Code: Select all
answer folder "Select your source folder:"; put it
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: revCopyFolder Issue
//10.0.15.2/qc/Metals Fab tracker
The files to be copied are on a server, are you asking me to map a network drive? if no I can use this
N:/Metals Fab tracker
do you think the / vs. \ is making the difference? im going to try it
The files to be copied are on a server, are you asking me to map a network drive? if no I can use this
N:/Metals Fab tracker
do you think the / vs. \ is making the difference? im going to try it
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här
Re: revCopyFolder Issue
OK, so im not sure what fixed it. I changed all the \ to /
Also I changed the destination path 1 step back.
revCopyFolder "//server/programpath/programfolder", "C:/"
this works perfect every time.
Also I changed the destination path 1 step back.
revCopyFolder "//server/programpath/programfolder", "C:/"
this works perfect every time.
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: revCopyFolder Issue
Example from the dictionary:
revCopyFolder "E:/Settings","C:/Program Files/My App/Settings"
revCopyFolder "E:/Settings","C:/Program Files/My App/Settings"
shiftLock happens
Re: revCopyFolder Issue
Thats where I started, from my testing the dictionary is either wrong all together or partially wrong when dealing with network locations in a windows environment or the 30+ computers I have at my office are specialExample from the dictionary:
revCopyFolder "E:/Settings","C:/Program Files/My App/Settings"
This is what works:
revCopyFolder "//ServerLocalIPaddress/Settings","C:/Program Files/My App"
I never tested this:
revCopyFolder "//ServerName/Settings","C:/Program Files/My App"
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här
Re: revCopyFolder Issue
DavJans wrote:revCopyFolder "\\server\programpath\programfolder", "C:/Programfolder"
I believe in Lc "/" is the default path character to use, for instance in the dictionary entry:DavJans wrote:OK, so im not sure what fixed it. I changed all the \ to /
The only other pertinent (although not used in your case) warning was not to use the tilde ~Examples:
revCopyFolder "E:/Settings","C:/Program Files/My App/Settings"
revCopyFolder "data","backups" <- unless specifying folders in the default folder location...
However, that isn't to say that this was the only or even a major problem, as you pointed out earlier, if the folder was non-existent, it copied it there by creating it. Other factors appear to have been involved.Note: On Linux and OS X systems, folder paths can contain the tilde (~) character, referring to the current user's home directory. Using these chars is not supported by revCopyFolder, and it is necessary to replace the tilde with its literal value (eg /home/userName)
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: revCopyFolder Issue
revCopyFolder uses shell (that is on Win: via cmd.exe under NT and else via cmd.com):
- winSourcePath and winDestPath are original windows pathes (using "\")
- IF the systemVersion is "NT 6.0" it uses
Code: Select all
-- for options see https://ss64.com/nt/robocopy.html get shell("robocopy" && winSourcePath && winDestPath && "/E /NFL /NDL /NS /NC /NJH /NJS")
- ELSE it uses
Code: Select all
-- for options see https://ss64.com/nt/xcopy.html get shell ("xcopy /I /E /Y /R" && winSourcePath && winDestPath)
shiftLock happens
Re: revCopyFolder Issue
from http://livecode.wikia.com/wiki/RevCopyFolder
...
It doesn't work on mobile devices.
On mobile device use this code:
Code: Select all
on copyFolder sFolder, dFolder #source folder, destination folder if char 1 of sFolder is not "/" then put the defaultFolder &"/"& sFolder into sFolder end if if char 1 of dFolder is not "/" then put the defaultFolder &"/"& dFolder into dFolder end if set itemdel to "/" put the last item of sFolder into folderName create folder dFolder put (dFolder &"/"& folderName & "/") into dFolder create folder dFolder set the defaultFolder to sFolder put the files into FileList repeat for each line tLine in FileList put URL ("binfile:" & sFolder &"/"& tLine) into URL ("file:" & dFolder &"/"& tLine ) end repeat put the folders into FolderList filter FolderList without "." filter FolderList without ".." repeat for each line tLine in Folderlist copyFolder tLine, (dFolder) end repeat end copyFolder
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w