Re: Rename File on Server not working?

2017-05-08 Thread Richard Gaskin via use-livecode

Rick Harrison wrote:

> Hi Richard,
>
> The result says:
>
> can't rename file (20)
>
> I see that you are using a “move file” in your example.
> The dictionary doesn’t show an example for moving a file.
>
> I tried the following example to see what would happen:
>
> move file OldImagePathAndFileName to tFileName
>   if the result is not empty then
>put the result && "(" & sysError() &")"
>  end if
>
> I’m getting:   move: missing ‘to'
>
> This seems rather bizarre to me.
>
> Your thoughts?

My bad: I was thinking of bash; in LC the "move" command is for moving 
controls but not file objects.  To move files we use "rename".


--
 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: Rename File on Server not working?

2017-05-08 Thread Rick Harrison via use-livecode
Hi Richard,

The result says:

can't rename file (20)

I see that you are using a “move file” in your example.
The dictionary doesn’t show an example for moving a file.

I tried the following example to see what would happen:

move file OldImagePathAndFileName to tFileName
  if the result is not empty then
put the result && "(" & sysError() &")"
 end if

I’m getting:   move: missing ‘to'

This seems rather bizarre to me.

Your thoughts?

Rick




> On May 8, 2017, at 7:29 PM, Richard Gaskin via use-livecode 
>  wrote:
> 
> Rick Harrison wrote:
>> I was trying to use rename file
>> on the Server in a .lc script
>> to rename a file.  It doesn’t
>> seem to work at all.  Can
>> someone please let me know
>> if it works on an LC Server?
> 
> It should.  Try checking the result immediately after, and if not empty call 
> sysError() for the OS error number, e.g.:
> 
>  move file tSrcPath to tDestPath
>  if the result is not empty then
> put the result && "(" & sysError() &")"
>  end if
> 
> -- 
> 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: Rename File on Server not working?

2017-05-08 Thread Richard Gaskin via use-livecode

Rick Harrison wrote:

I was trying to use rename file
on the Server in a .lc script
to rename a file.  It doesn’t
seem to work at all.  Can
someone please let me know
if it works on an LC Server?


It should.  Try checking the result immediately after, and if not empty 
call sysError() for the OS error number, e.g.:


  move file tSrcPath to tDestPath
  if the result is not empty then
 put the result && "(" & sysError() &")"
  end if

--
 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

Rename File on Server not working?

2017-05-08 Thread Rick Harrison via use-livecode
Hi there,

I was trying to use rename file
on the Server in a .lc script
to rename a file.  It doesn’t
seem to work at all.  Can
someone please let me know
if it works on an LC Server?

Thanks,

Rick
___
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