put url works on Mac but NOT on Windows 10 (for me!)

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

put url works on Mac but NOT on Windows 10 (for me!)

Post by Traxgeek » Sat Apr 29, 2017 2:53 pm

Hi,
I'm sure this must have been covered somewhere before but i seem unable to locate it...

I have the following line of code :
put url sURL into url ("binfile:" & gsAppDataPath & "/" & gsTempFilesFolder & "/" & sFileName)

Assuming all variables are declared, populated and contain no obvious errors, the line works as expected on my Mac : the file referred to by "sURL" is copied to a 'Temp Files' folder within an app-specific folder and with a new name ON MY MAC. When I look at the 'the result' (answer the result), immediately after the above line, I get a null field (all great here ! ) .

However, when I execute the exact same line of code on my Win 10 laptop I get a 'can't open file' error reported by 'the result'...

Anyone able to tell me why please ?

For clarity, this line is in an app I'm writing that operates perfectly on my Mac but when I run the exact same 'app' on my Win 10 PC I get the error (on the exact same file) and no file ends up in my 'Temp Files' folder...

Is this maybe a permissions thing ? Any and all help, as always, is much appreciated.
Thanks a mil. Have a great weekend.
Best
Trax
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: put url works on Mac but NOT on Windows 10 (for me!)

Post by FourthWorld » Sat Apr 29, 2017 4:17 pm

Traxgeek wrote:However, when I execute the exact same line of code on my Win 10 laptop I get a 'can't open file' error reported by 'the result'...
LiveCode offers a sysError function which tells us the error code from the last system error that occurred.

If you modify your check of the result to include a call to sysError you may find the specific reason for the failure:

Code: Select all

put url sURL into url ("binfile:" & gsAppDataPath & "/" & gsTempFilesFolder & "/" & sFileName)
if the result is not empty then
    answer the result && "("& sysError() &")"
    exit to top
end if
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: put url works on Mac but NOT on Windows 10 (for me!)

Post by Traxgeek » Sat Apr 29, 2017 9:00 pm

Hi Richard,
I'd clean forgotten about sysError. :oops:
It reports "123".

I'm off to look that up now and will revert once I have some ideas.
Thanks for your quick response.
Best
Trax
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: put url works on Mac but NOT on Windows 10 (for me!)

Post by Traxgeek » Sat Apr 29, 2017 9:13 pm

Further to my last...
there seems to be any number of reasons for a Windows System Error of 123 being reported BUT (and I may well be wrong) seeing as I was trying to copy a file from one location to another I can only assume that it's the fact that whilst the Mac doesn't have any particular problem with my file name Windows may well have...
If this is the case then it may well be that 'The Filename, Directory Name, or Volume Label Syntax Is Incorrect'... now, why my Mac doesn't have an issue with the file name and Windows does remains a mystery to me for the moment...
I'm off to fire up both laptops side-by-side and run EXACTLY the same file on both and see if I can spot which of the two file names poses the issue and what, if any, is the difference (apart from the fact that the Mac won't throw an error) between them !
I'll revert with more as I work it out. Any and all help will, as always, help put me out of my mysery sooner !
Thanks a mil.
Best
Trax
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

tomBTG
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 73
Joined: Fri Nov 25, 2011 6:42 pm

Re: put url works on Mac but NOT on Windows 10 (for me!)

Post by tomBTG » Sun Apr 30, 2017 2:37 pm

Trax,

If you have not solved this by now, here are two long shots to consider:

Could this be a rare case of case sensitivity?
See stackoverflow: http://stackoverflow.com/questions/7199 ... -sensitive

Or a special character that Mac supports and PC doesn't in the file/path names?

Tom B.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: put url works on Mac but NOT on Windows 10 (for me!)

Post by FourthWorld » Sun Apr 30, 2017 3:19 pm

Traxgeek wrote:...why my Mac doesn't have an issue with the file name and Windows does remains a mystery to me for the moment...
MacOS and Windows are very different under the hood, and while both file systems are case-insensitive by default there may be exceptions on either, and there are other differences as well.

Can you post the path your program is attempting to use on each?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply