Re: Windows Equivalents for Shell: cp (copy)

2016-07-11 Thread Mike Bonner
Windows has copy and xcopy as well as move and rename along with a bunch of
other nifty things.

On Mon, Jul 11, 2016 at 9:18 PM, Sannyasin Brahmanathaswami <
bra...@hindu.org> wrote:

> What alternatives do we have for basic shell commands on Windows?
>
> Rumors are out that later this year, Windows will support bash.. and
> perhaps then Livecode's shell calls to unix/bash commands will be cross
> platform--  like the one (cp) in this script below. But until then, can
> anyone provide an alternative that works on Windows?
>
> RevCopyFile (which works on Windows) doesn't offer the option to copy to a
> different filename…
>
> I suppose I can copy the file and then rename the copy at the new
> destination, using "rename"  which is simple enough.
>
> But I was wondering if there are any native windows alternatives to unix
> "cp" that writes the same file to another file with a different name in
> "one go."
>
>
> on backupStack
>
> save the topstack
>
> # get a time stamp
>
> put the internet date into tDateTime
>
> convert tDateTime to dateitems
>
> delete the last item of tDateTime
>
> if item 4 of tDateTime > 12 then
>
> subtract 12 from item 4 of tDateTime
>
> put "pm" into the last item of tDateTime
>
> end if
>
> replace comma with "-" in tDateTime
>
> # get the path of the stack
>
> # set up the copy
>
> put the effective filename of the topstack into tCurrentPath
>
> put tCurrentPath into tCopyPath
>
> set the itemdel to "/"
>
> # always back up to one level above current working folder
>
> delete item -4 to -2 of tCopyPath
>
> put "/zArchives" after item -2 of tCopyPath
>
> # put tCopyPath; exit to top;
>
> replace ".livecode" with ("_" & tDateTime & ".bac") in tCopyPath
>
> put ("cp " & quote & tCurrentPath & quote &" "& quote & tCopyPath & quote)
> into tShell
>
> get shell(tShell)
>
> # auto fire every half hour
>
> send backupStack to me in 1800 seconds
>
> end backupStack
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Windows Equivalents for Shell: cp (copy)

2016-07-11 Thread J. Landman Gay

On 7/11/2016 10:18 PM, Sannyasin Brahmanathaswami wrote:

RevCopyFile (which works on Windows) doesn't offer the option to copy
to a different filename…

I suppose I can copy the file and then rename the copy at the new
destination, using "rename"  which is simple enough.


This works:

  put  into tCopyPath
  put the effective filename of this stack into tCurrentPath
  set the filename of this stack to tCopyPath
  save this stack
  set the filename of this stack to tCurrentPath
  save this stack -- reset

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread Mike Bonner
or the url method
put url "binfile:path/to/in/file into url "binfile:path/to/out/file"

On Tue, Jul 12, 2016 at 12:42 AM, J. Landman Gay 
wrote:

> On 7/11/2016 10:18 PM, Sannyasin Brahmanathaswami wrote:
>
>> RevCopyFile (which works on Windows) doesn't offer the option to copy
>> to a different filename…
>>
>> I suppose I can copy the file and then rename the copy at the new
>> destination, using "rename"  which is simple enough.
>>
>
> This works:
>
>   put  into tCopyPath
>   put the effective filename of this stack into tCurrentPath
>   set the filename of this stack to tCopyPath
>   save this stack
>   set the filename of this stack to tCurrentPath
>   save this stack -- reset
>
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread [-hh]
Or simply (works on each supported platform):

save stack as 



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Windows-Equivalents-for-Shell-cp-copy-tp4706590p4706598.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread Richard Gaskin

Sannyasin Brahmanathaswami wrote:

> What alternatives do we have for basic shell commands on Windows?
>
> Rumors are out that later this year, Windows will support bash.. and
> perhaps then Livecode's shell calls to unix/bash commands will be
> cross platform--

Ubuntu's bash environment is available for Windows 10 now - here's how 
to get started:



Useful for many sysadmin tasks, but for just copying LC stack files from 
within the IDE the LC Script examples the others gave are probably 
simpler options.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread Roger Eller
Most Windows Server admins I know use xcopy.  It has far more control over
attributes than the standard copy command.

http://commandwindows.com/xcopy.htm

~Roger


On Tue, Jul 12, 2016 at 10:20 AM, Richard Gaskin  wrote:

> Sannyasin Brahmanathaswami wrote:
>
> > What alternatives do we have for basic shell commands on Windows?
> >
> > Rumors are out that later this year, Windows will support bash.. and
> > perhaps then Livecode's shell calls to unix/bash commands will be
> > cross platform--
>
> Ubuntu's bash environment is available for Windows 10 now - here's how to
> get started:
> 
>
> Useful for many sysadmin tasks, but for just copying LC stack files from
> within the IDE the LC Script examples the others gave are probably simpler
> options.
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  
>  ambassa...@fourthworld.comhttp://www.FourthWorld.com
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread J. Landman Gay
The problem with "save as"  is that you end up working in the backup copy 
instead of the original.


Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com



On July 12, 2016 3:01:48 AM "[-hh]"  wrote:


Or simply (works on each supported platform):

save stack as 



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Windows-Equivalents-for-Shell-cp-copy-tp4706590p4706598.html

Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread Roger Eller
How about modifying the save option to automatically copy and rename as a
versioned file.


On Tue, Jul 12, 2016 at 11:24 AM, J. Landman Gay 
wrote:

> The problem with "save as"  is that you end up working in the backup copy
> instead of the original.
>
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
>
>
>
> On July 12, 2016 3:01:48 AM "[-hh]"  wrote:
>
> Or simply (works on each supported platform):
>>
>> save stack as 
>>
>>
>>
>> --
>> View this message in context:
>> http://runtime-revolution.278305.n4.nabble.com/Windows-Equivalents-for-Shell-cp-copy-tp4706590p4706598.html
>> Sent from the Revolution - User mailing list archive at Nabble.com.
>>
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread [-hh]
Jacqueline LG wrote:
> The problem with "save as"  is that you end up working in the backup
> copy instead of the original.

Roger E. wrote
> How about modifying the save option to automatically copy and rename
> as a versioned file.

Yes, one can simply decide which one to use as backup.
I use it (similar in other apps) as follows.

Start with a stack fileName1. Then

save
save as fileName2

After these two lines fileName1 is the "backUp" and fileName2 is the
current exemplar for working. And so on.



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Windows-Equivalents-for-Shell-cp-copy-tp4706590p4706622.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread Peter TB Brett



On 12/07/2016 16:35, Roger Eller wrote:

How about modifying the save option to automatically copy and rename as a
versioned file.


A "save copy as" command?

   Peter

--
Dr Peter Brett 
LiveCode Technical Project Manager

LiveCode 2016 Conference https://livecode.com/edinburgh-2016/

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread Dr. Hawkins
On Tue, Jul 12, 2016 at 12:18 AM, [-hh]  wrote:

> save stack as 


When I use this one, though, execution stops.  I've been meaning to ask
about this  . . .

I use it in a bmpVrsn routine to increment the file name of my various
stacks (it also checks for and changes the date, making new directories as
needed).  Once it saves, though, it issues a dialog asking about the
old/new stack names ("before saving, what do you want to do with . . .
save/cancel/purge")

What I *want* to happen is or the old stack to end up out of memory, and
the new stack (which has the same name) to take its place.

-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread Sannyasin Brahmanathaswami
Actually I want the opposite.

I want the original file to stay in memory…

back ups are tagged with time and date

surprise-me-2016-07-12-15-21-00.bac#  3:21 PM
surprise-me-2016-07-12-15-36-00.bac  # 15 minutes later

BR

From: use-livecode  on behalf of "Dr. 
Hawkins" 
Reply-To: How LiveCode 
Date: Tuesday, July 12, 2016 at 6:58 AM
To: How LiveCode 
Subject: Re: Windows Equivalents for Shell: cp (copy)

What I *want* to happen is or the old stack to end up out of memory, and
the new stack (which has the same name) to take its place.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread Sannyasin Brahmanathaswami

which file is in memory after we do this, the original, or the copy with a new 
name?


A "save copy as" command?

Peter


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread Richard Gaskin

Sannyasin Brahmanathaswami wrote:

> which file is in memory after we do this, the original, or the copy
> with a new name?
>
> A "save copy as" command?

I was hoping to see how the Dictionary describes that, but the 
Dictionary entry for "save" doesn't seem to mention a "copy" option at all.


The syntax guide for "save" is:

  save stack [as filePath] [with format stackFormat |
 with newest format]

It does include this:

  Use the save command to save changes to a stack
  or to save a copy of a stack into another file.

...but it doesn't seem to offer any guidance on the syntax for copying.

Did I miss something?

When was "copy" introduced?

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread Peter TB Brett

On 12/07/2016 22:08, Richard Gaskin wrote:

Sannyasin Brahmanathaswami wrote:


which file is in memory after we do this, the original, or the copy
with a new name?

A "save copy as" command?


I was hoping to see how the Dictionary describes that, but the
Dictionary entry for "save" doesn't seem to mention a "copy" option at all.

The syntax guide for "save" is:

  save stack [as filePath] [with format stackFormat |
 with newest format]

It does include this:

  Use the save command to save changes to a stack
  or to save a copy of a stack into another file.

...but it doesn't seem to offer any guidance on the syntax for copying.

Did I miss something?

When was "copy" introduced?


It wasn't.

I was proposing that Brahmanathaswami might like to make an enhancement 
request!


   Peter

--
Dr Peter Brett 
LiveCode Technical Project Manager

LiveCode 2016 Conference https://livecode.com/edinburgh-2016/

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread J. Landman Gay

On 7/12/2016 4:08 PM, Richard Gaskin wrote:

Sannyasin Brahmanathaswami wrote:


which file is in memory after we do this, the original, or the copy
with a new name?

A "save copy as" command?

...

Did I miss something?

When was "copy" introduced?



It wasn't, it's being proposed.

For now, the easiest way to make a backup stack is to use Mike's 
suggestion to "put URL x into URL y". I should have thought of that when 
I made my more verbose suggestion but it was the crack of noon when I 
answered and I hadn't had coffee yet.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread Mike Bonner
Can't you "save stack as.." and then set the filename of the stack back to
what it was?

On Tue, Jul 12, 2016 at 3:18 PM, J. Landman Gay 
wrote:

> On 7/12/2016 4:08 PM, Richard Gaskin wrote:
>
>> Sannyasin Brahmanathaswami wrote:
>>
>> which file is in memory after we do this, the original, or the copy
>>> with a new name?
>>>
>>> A "save copy as" command?
>>>
>> ...
>>
>> Did I miss something?
>>
>> When was "copy" introduced?
>>
>>
> It wasn't, it's being proposed.
>
> For now, the easiest way to make a backup stack is to use Mike's
> suggestion to "put URL x into URL y". I should have thought of that when I
> made my more verbose suggestion but it was the crack of noon when I
> answered and I hadn't had coffee yet.
>
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread [-hh]
The interesting question about that is now:
What is in memory after
[1] save?
[2] save as?
[3] save copy as (not yet implemented)?

If I'm correct then it is ALWAYS the same, NOTHING is
changed in memory. Only with [2] the file on disk is
changed to which the object in memory links (and which
is used for the next save or revert command).

So we can use save and one or both of [2] or [3].
This yields of course different backup methods, but your
work goes on in any case with an unchanged object in memory.




--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Windows-Equivalents-for-Shell-cp-copy-tp4706590p4706660.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread Roger Eller
I thought the rename command allows for a different destination.
Therefore, rename is actually "copy as new name" when the volumes or drive
letters differ.

~Roger
On Jul 11, 2016 11:19 PM, "Sannyasin Brahmanathaswami" 
wrote:

> What alternatives do we have for basic shell commands on Windows?
>
> Rumors are out that later this year, Windows will support bash.. and
> perhaps then Livecode's shell calls to unix/bash commands will be cross
> platform--  like the one (cp) in this script below. But until then, can
> anyone provide an alternative that works on Windows?
>
> RevCopyFile (which works on Windows) doesn't offer the option to copy to a
> different filename…
>
> I suppose I can copy the file and then rename the copy at the new
> destination, using "rename"  which is simple enough.
>
> But I was wondering if there are any native windows alternatives to unix
> "cp" that writes the same file to another file with a different name in
> "one go."
>
>
> on backupStack
>
> save the topstack
>
> # get a time stamp
>
> put the internet date into tDateTime
>
> convert tDateTime to dateitems
>
> delete the last item of tDateTime
>
> if item 4 of tDateTime > 12 then
>
> subtract 12 from item 4 of tDateTime
>
> put "pm" into the last item of tDateTime
>
> end if
>
> replace comma with "-" in tDateTime
>
> # get the path of the stack
>
> # set up the copy
>
> put the effective filename of the topstack into tCurrentPath
>
> put tCurrentPath into tCopyPath
>
> set the itemdel to "/"
>
> # always back up to one level above current working folder
>
> delete item -4 to -2 of tCopyPath
>
> put "/zArchives" after item -2 of tCopyPath
>
> # put tCopyPath; exit to top;
>
> replace ".livecode" with ("_" & tDateTime & ".bac") in tCopyPath
>
> put ("cp " & quote & tCurrentPath & quote &" "& quote & tCopyPath & quote)
> into tShell
>
> get shell(tShell)
>
> # auto fire every half hour
>
> send backupStack to me in 1800 seconds
>
> end backupStack
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Windows Equivalents for Shell: cp (copy)

2016-07-12 Thread Phil Davis

From the dictionary:

   The rename command can be used to change a file's or folder's
   location only if the old and new locations are both on the same volume.

Phil Davis


On 7/12/16 5:23 PM, Roger Eller wrote:

I thought the rename command allows for a different destination.
Therefore, rename is actually "copy as new name" when the volumes or drive
letters differ.

~Roger
On Jul 11, 2016 11:19 PM, "Sannyasin Brahmanathaswami" 
wrote:


What alternatives do we have for basic shell commands on Windows?

Rumors are out that later this year, Windows will support bash.. and
perhaps then Livecode's shell calls to unix/bash commands will be cross
platform--  like the one (cp) in this script below. But until then, can
anyone provide an alternative that works on Windows?

RevCopyFile (which works on Windows) doesn't offer the option to copy to a
different filename…

I suppose I can copy the file and then rename the copy at the new
destination, using "rename"  which is simple enough.

But I was wondering if there are any native windows alternatives to unix
"cp" that writes the same file to another file with a different name in
"one go."


on backupStack

save the topstack

# get a time stamp

put the internet date into tDateTime

convert tDateTime to dateitems

delete the last item of tDateTime

if item 4 of tDateTime > 12 then

subtract 12 from item 4 of tDateTime

put "pm" into the last item of tDateTime

end if

replace comma with "-" in tDateTime

# get the path of the stack

# set up the copy

put the effective filename of the topstack into tCurrentPath

put tCurrentPath into tCopyPath

set the itemdel to "/"

# always back up to one level above current working folder

delete item -4 to -2 of tCopyPath

put "/zArchives" after item -2 of tCopyPath

# put tCopyPath; exit to top;

replace ".livecode" with ("_" & tDateTime & ".bac") in tCopyPath

put ("cp " & quote & tCurrentPath & quote &" "& quote & tCopyPath & quote)
into tShell

get shell(tShell)

# auto fire every half hour

send backupStack to me in 1800 seconds

end backupStack


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


--
Phil Davis

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode