I can't for the life of me get the Dos Move command using shell in rev to work.
and after hard searching have come up with very little info.
I have 2 variables, one is the file path = fPath other is destination folder path = destFolderPath
As this works fine in cmd.exe: move "C:\test folderA\testfile.txt" "C:\test folderB I've tried several ways to put that into a working shell command in rev with no luck.
I imagin this is pretty easy, but once again lack of info is holding me back.
for one thing the the examples in the documentation don't even look like they cold work, wouldn't a put or open be needed ???
logically in my case something like:
open shell(move fPath destFolder Path)
UPDATE: I think i got it I built the whole thing quotes move and all into one variable before hand.
I would still like more info on this if possible.
Want to use Shell Move command
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Location: Aalst, Belgium
- Contact:
You have to properly combine the data into a string that looks exeactly like what you would type at the DOS prompt. S that owould look like:
Though if your goal is to move a file, you can use the 'rename' command:
Make sure to use the proper file path formats: internaly, Revolution uses UNIX style paths - so if you get a file path from the 'ask file', 'answer file' or 'answer directory' commands, you'll have to convert these to platform-specific paths before using the 'shell' function or assembling applescript or vbscript statement lists.
See also the 'revMacFromUnixPath' and 'revUnixFromMacPath' functions - in case of Windows, you can simply replace "/" with "\" in the filepath to cobvert from Unix to Windows paths.
Hope this helped,
Jan Schenkel.
Code: Select all
put "move && quote & fPath & quote && quote & destFolderPath & quote into tShellCommand
get shell(tShellCommand)
Code: Select all
on mouseUp
answer file "Pick a file to move to the desktop"
if it is empty then exit mouseUp
put it into tFilePath -- UNIX style filepath
set the itemDelimiter to "/"
put item -1 of tFilePath into tFileName
put specialFolder("desktop") & "/" tFileName into tDestFileName
rename file tFilePath to tDestFileName
end mouseUp
See also the 'revMacFromUnixPath' and 'revUnixFromMacPath' functions - in case of Windows, you can simply replace "/" with "\" in the filepath to cobvert from Unix to Windows paths.
Hope this helped,
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
yep the replace "/" with "\" in lMover was the real blocker (I should have remembered that I got that from another kind sole on this list, 47 questions ago.
I don't want to use rename for two reasons, 1 it only works on same volume, and 2 it resets the last Modified property of the file (of critical importance when working with backup files).
I had been using revcopyfile (its really just a glorified DOS copy in windows), but that is slow with large files and having to have a delete command (even with good checks) didn't sit well.
I got Move working now and it works great and fast
Once again thank you for your great info.
I don't want to use rename for two reasons, 1 it only works on same volume, and 2 it resets the last Modified property of the file (of critical importance when working with backup files).
I had been using revcopyfile (its really just a glorified DOS copy in windows), but that is slow with large files and having to have a delete command (even with good checks) didn't sit well.
I got Move working now and it works great and fast
Once again thank you for your great info.