Database Setup

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Database Setup

Mike Kerner via use-livecode
Sooo... having shared my Database Setup card with another user, which is an sqlYoga wrapper if you will for connecting to mySQL and sqLite databases, I'm thinking about posting this in some fashion so that others can have a look, refine it, skin it etc. Is there such a thing for end user stuff on GitHub, or do I need to create my own git repository?

Bob S



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Rename File on Server not working?

Mike Kerner 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
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Rename File on Server not working?

Mike Kerner 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
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Rename File on Server not working?

Mike Kerner 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 <[hidden email]> 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
> ____________________________________________________________________
> [hidden email]                http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Rename File on Server not working?

Mike Kerner 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
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

sysError List?

Mike Kerner via use-livecode
Hi there,

Does anyone know where I can a sysError list
so I can figure out what the numbers mean?

Thanks,

Rick

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: sysError List?

Mike Kerner via use-livecode
Rick Harrison wrote:

 > Does anyone know where I can a sysError list
 > so I can figure out what the numbers mean?

The value returned from sysError is the OS error ID, which will vary
from OS to OS and is subject to change.

I usually do a search at Google for something like:

   Windows OS error 20

I looked up yours and it seems to be either "invalid path" or "device
not found", depending on the OS and version.  They may be related, where
perhaps "device" refers to storage device.

What are the source and dest paths you were using with your rename command?

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: sysError List?

Mike Kerner via use-livecode
Hi Richard,

I did some experiments and did get one instance
of rename to work properly.  Apparently I had
a permissions problem with writing to the folder/file.

I did the search on google for macOS errors.  The
lists that I found weren’t much help and said at
the very beginning that they weren’t up to date.
It also stated they could in fact be entirely wrong
due to frequent updates of error codes.

Other issues I’m running into are:

1.  I’m running into some 32,767 array size
     error when trying to upload large images
     to the server.  Images smaller than
     the magic figure upload fine, and larger
     files over that figure throw and error
     message and fail to upload.

2.  Where can I find the LiveCode tmp folder
     where the images are initially uploaded?

     I need the complete file path to that so
     I can move the images where I want them.
     Unless there is a way I can upload directly
     to the file folder I want?

Thanks for your help!

Rick

> On May 9, 2017, at 3:40 PM, Richard Gaskin via use-livecode <[hidden email]> wrote:
>
> The value returned from sysError is the OS error ID, which will vary from OS to OS and is subject to change.
>
> I usually do a search at Google for something like:
>
>  Windows OS error 20
>
> I looked up yours and it seems to be either "invalid path" or "device not found", depending on the OS and version.  They may be related, where perhaps "device" refers to storage device.
>
> What are the source and dest paths you were using with your rename command?
>
> --
> Richard Gaskin


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: sysError List?

Mike Kerner via use-livecode
Rick Harrison wrote:

 > I did some experiments and did get one instance
 > of rename to work properly.  Apparently I had
 > a permissions problem with writing to the folder/file.

Yep, most things with file I/O that fails are either paths or
permissions.  Glad you got that sorted.

 > Other issues I’m running into are:
 >
 > 1.  I’m running into some 32,767 array size
 >      error when trying to upload large images
 >      to the server.  Images smaller than
 >      the magic figure upload fine, and larger
 >      files over that figure throw and error
 >      message and fail to upload.

"array size"?  Where is that error coming from, the client or the server?


 > 2.  Where can I find the LiveCode tmp folder
 >      where the images are initially uploaded?
 >
 >      I need the complete file path to that so
 >      I can move the images where I want them.
 >      Unless there is a way I can upload directly
 >      to the file folder I want?

I generally only use standalones on the server, and I handle buffering
to disk myself.

Anyone here know if LC Server does that differently?  If so, where are
those temp files?

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: sysError List?

Mike Kerner via use-livecode
Hi Richard,

Sorry it has been a couple days before I could
get back to this task.

Ok, so my file uploaded to:  /tmp/livecode_qpSKBPng

I thought that perhaps tmp was a hidden folder
so I looked on my Mac after first unhiding all files.
I’m still not seeing it.  Where is this located?

Then I’m getting an error 20 when I try to
rename (move) the file to the proper folder
where I want it to go.  I don’t know what
error 20 is.  Does it mean it is a permissions
problem?  The file wasn’t found?  I don’t know.

Let me know if you have any ideas.

Thanks,

Rick



> On May 9, 2017, at 8:20 PM, Richard Gaskin via use-livecode <[hidden email]> wrote:
>
> Rick Harrison wrote:
>
> > I did some experiments and did get one instance
> > of rename to work properly.  Apparently I had
> > a permissions problem with writing to the folder/file.
>
> Yep, most things with file I/O that fails are either paths or permissions.  Glad you got that sorted.
>
> > Other issues I’m running into are:
> >
> > 1.  I’m running into some 32,767 array size
> >      error when trying to upload large images
> >      to the server.  Images smaller than
> >      the magic figure upload fine, and larger
> >      files over that figure throw and error
> >      message and fail to upload.
>
> "array size"?  Where is that error coming from, the client or the server?
>
>
> > 2.  Where can I find the LiveCode tmp folder
> >      where the images are initially uploaded?
> >
> >      I need the complete file path to that so
> >      I can move the images where I want them.
> >      Unless there is a way I can upload directly
> >      to the file folder I want?
>
> I generally only use standalones on the server, and I handle buffering to disk myself.
>
> Anyone here know if LC Server does that differently?  If so, where are those temp files?
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> [hidden email]                http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: sysError List?

Mike Kerner via use-livecode
Rick Harrison wrote:

 > Sorry it has been a couple days before I could
 > get back to this task.
 >
 > Ok, so my file uploaded to:  /tmp/livecode_qpSKBPng
 >
 > I thought that perhaps tmp was a hidden folder
 > so I looked on my Mac after first unhiding all files.
 > I’m still not seeing it.  Where is this located?
 >
 > Then I’m getting an error 20 when I try to
 > rename (move) the file to the proper folder
 > where I want it to go.  I don’t know what
 > error 20 is.  Does it mean it is a permissions
 > problem?  The file wasn’t found?  I don’t know.

What path do you get with the specialFolderPath function?, e.g.:

   put specialFolderPath("temporary") &"/livecode_qpSKBPng" \
      into tPath

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: sysError List?

Mike Kerner via use-livecode
Hi Richard,

That yields:

tPath = /livecode_qpSKBPng

Does that help?

Rick

> On May 12, 2017, at 2:54 PM, Richard Gaskin via use-livecode <[hidden email]> wrote:
>
>  put specialFolderPath("temporary") &"/livecode_qpSKBPng" \
>     into tPath

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: sysError List?

Mike Kerner via use-livecode
Rick Harrison wrote:

 >> On May 12, 2017, at 2:54 PM, Richard Gaskin wrote:
 >>
 >>  put specialFolderPath("temporary") &"/livecode_qpSKBPng" \
 >>     into tPath
 >
 > That yields:
 >
 > tPath = /livecode_qpSKBPng
 >
 > Does that help?

Scary.  Looks like the specialFolderPath function is returning empty
with the "temporary" constant on your system?

LC and OS versions?

Just for diagnostics, what does this do there?:

   put specialFolderPath("documents")

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: sysError List?

Mike Kerner via use-livecode
Hi Richard,

LC version 8.1.4-rc-1
macOS El Capitan (10.11.6)

put specialFolderPath("documents”)

yields:
/Library/WebServer/Documents

Your thoughts?

Rick

> On May 12, 2017, at 5:10 PM, Richard Gaskin via use-livecode <[hidden email]> wrote:
>
> Scary.  Looks like the specialFolderPath function is returning empty with the "temporary" constant on your system?
>
> LC and OS versions?
>
> Just for diagnostics, what does this do there?:
>
>  put specialFolderPath("documents")
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: sysError List?

Mike Kerner via use-livecode
Rick Harrison wrote:
 > LC version 8.1.4-rc-1
 > macOS El Capitan (10.11.6)
 >
 > put specialFolderPath("documents”)
 >
 > yields:
 > /Library/WebServer/Documents
 >
 > Your thoughts?

What does this return?:

   put specialFolderPath("temporary")

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: sysError List?

Mike Kerner via use-livecode
Hi Richard,

It returns blank.

So now what?

Rick

> On May 12, 2017, at 10:40 PM, Richard Gaskin via use-livecode <[hidden email]> wrote:
>
>  put specialFolderPath("temporary")

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: sysError List?

Mike Kerner via use-livecode
Rick Harrison wrote:

 >> On May 12, 2017, at 10:40 PM, Richard Gaskin wrote:
 >>
 >>  put specialFolderPath("temporary")
 >
 > Hi Richard,
 >
 > It returns blank.
 >
 > So now what?

That value is either accurate or inaccurate. Either way, it seems a bug
- the question is, where?

If accurate, it would appear there's something very unusual about your
OS config, since temp files are a common necessity in modern OSes.

If inaccurate, it would appear to be a bug in LC 8.1.4 RC1.

Have you tried that in 8.1.4 RC2?
http://downloads.livecode.com/livecode/

If the problem is repeatable with the latest build you might want to
file a bug report on that.

FWIW, testing both LC 8.1.4 RC2 and 9.0 DP6 I get a valid path to my
system's temp folder.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: sysError List?

Mike Kerner via use-livecode
Hi Richard,

Ok, I’ll try an upgrade to 8.1.4 RC2 to see if that works,
and then get back to you.

Thanks,

Rick

> On May 13, 2017, at 11:15 AM, Richard Gaskin via use-livecode <[hidden email]> wrote:
>
> Rick Harrison wrote:
>
> >> On May 12, 2017, at 10:40 PM, Richard Gaskin wrote:
> >>
> >>  put specialFolderPath("temporary")
> >
> > Hi Richard,
> >
> > It returns blank.
> >
> > So now what?
>
> That value is either accurate or inaccurate. Either way, it seems a bug - the question is, where?
>
> If accurate, it would appear there's something very unusual about your OS config, since temp files are a common necessity in modern OSes.
>
> If inaccurate, it would appear to be a bug in LC 8.1.4 RC1.
>
> Have you tried that in 8.1.4 RC2?
> http://downloads.livecode.com/livecode/
>
> If the problem is repeatable with the latest build you might want to file a bug report on that.
>
> FWIW, testing both LC 8.1.4 RC2 and 9.0 DP6 I get a valid path to my system's temp folder.
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> [hidden email]                http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: sysError List?

Mike Kerner via use-livecode
In reply to this post by Mike Kerner via use-livecode
Hi Richard,

Ok, so I did the upgrade to version 8.1.4 RC 2 and
after rebooting I found that it made no difference at all.

When you are using lc-server and use
the following script, what do you get?

<?lc
put specialFolderPath("temporary")
?>

Thanks,

Rick

> On May 13, 2017, at 11:15 AM, Richard Gaskin via use-livecode <[hidden email]> wrote:
>
> That value is either accurate or inaccurate. Either way, it seems a bug - the question is, where?
>
> If accurate, it would appear there's something very unusual about your OS config, since temp files are a common necessity in modern OSes.
>
> If inaccurate, it would appear to be a bug in LC 8.1.4 RC1.
>
> Have you tried that in 8.1.4 RC2?
> http://downloads.livecode.com/livecode/
>
> If the problem is repeatable with the latest build you might want to file a bug report on that.
>
> FWIW, testing both LC 8.1.4 RC2 and 9.0 DP6 I get a valid path to my system's temp folder.
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> [hidden email]                http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: sysError List?

Mike Kerner via use-livecode
I don't normally use LC Server because its syntax cannot be tested in
the IDE, preferring to use standalones in server apps.

But I just downloaded LCS 8,.1.4 RC2, and running it from the command
line with your sample script yields the expected valid path to my temp
folder.

You may have found a Mac-specific bug worth reporting:
http://quality.livecode.com/

--
  Richard Gaskin
  Fourth World Systems

Rick Harrison wrote:

> Hi Richard,
>
> Ok, so I did the upgrade to version 8.1.4 RC 2 and
> after rebooting I found that it made no difference at all.
>
> When you are using lc-server and use
> the following script, what do you get?
>
> <?lc
> put specialFolderPath("temporary")
> ?>
>
> Thanks,
>
> Rick
>
>> On May 13, 2017, at 11:15 AM, Richard Gaskin via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>> That value is either accurate or inaccurate. Either way, it seems a bug - the question is, where?
>>
>> If accurate, it would appear there's something very unusual about your OS config, since temp files are a common necessity in modern OSes.
>>
>> If inaccurate, it would appear to be a bug in LC 8.1.4 RC1.
>>
>> Have you tried that in 8.1.4 RC2?
>> http://downloads.livecode.com/livecode/
>>
>> If the problem is repeatable with the latest build you might want to file a bug report on that.
>>
>> FWIW, testing both LC 8.1.4 RC2 and 9.0 DP6 I get a valid path to my system's temp folder.
>>
>> --
>> Richard Gaskin
>> Fourth World Systems
>> Software Design and Development for the Desktop, Mobile, and the Web
>> ____________________________________________________________________
>> Ambassador at FourthWorld.com                http://www.FourthWorld.com


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
12