Page 1 of 1

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

Posted: Sat Apr 29, 2017 2:53 pm
by Traxgeek
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

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

Posted: Sat Apr 29, 2017 4:17 pm
by FourthWorld
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

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

Posted: Sat Apr 29, 2017 9:00 pm
by Traxgeek
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

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

Posted: Sat Apr 29, 2017 9:13 pm
by Traxgeek
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

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

Posted: Sun Apr 30, 2017 2:37 pm
by tomBTG
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.

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

Posted: Sun Apr 30, 2017 3:19 pm
by FourthWorld
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?