Crash LC with just a slash

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10352
Joined: Wed May 06, 2009 2:28 pm

Crash LC with just a slash

Post by dunbarx » Mon Mar 28, 2016 10:02 pm

I am a newbie at writing to external text files. I made a new stack (v. 6.7.9) with one button. It is an instance of a project I am working on. In the button script:

Code: Select all

on mouseUp
   answer folder "XYZ"

    put it into tPath --DEOS NOT WORK, BUT AT LEAST NO CRASH
   --put it & "/" into tPath --THIS WILL CRASH LC BIGTIME
  
   open file tPath for text write
   write "ABC" to file tPath
   close file tPath
end mouseUp
Click the button with the first "put..." line, I get "Can't open that file. Well, I will figure this out, because a standalone for Windows with much the same code works just fine.

But, if I use the second "put.." line, with the forward slash appended, LC shuts down at the "write" line with a spinning beach ball. It cannot be force-quit. I have to restart.

Oddly, when I do try to force quit, the name of the LC application disappears from the list of open apps in the force-quit dialog, but all stack windows stay put. The rest of the computer works just fine. If I then go to the Activity Monitor, I see the LC process, appended with "not responding", like in the force-quit dialog, but my efforts to quit from that place fail. Restarting is the only way out.

So, notwithstanding I may have syntax errors in properly delineating the pathname, what is with that sinister slash?

I have the stack, but I do not recommend opening it unless everything else is saved, and you have a few spare minutes to waste. I will send it to to QCC unless someone sees what I am doing so egregiously wrongly.

Craig Newman

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

Re: Crash LC with just a slash

Post by FourthWorld » Mon Mar 28, 2016 10:20 pm

Doesn't crash in v8 under Ubuntu; haven't tested any other configuration.

But FWIW the write should fail since only the folder is in the path, but no file name.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10352
Joined: Wed May 06, 2009 2:28 pm

Re: Crash LC with just a slash

Post by dunbarx » Mon Mar 28, 2016 10:48 pm

Richard.

Thanks, Sloppy submission. I have my Mac and PC versions running fine. Thank you.

The slasher still lurks out there. I will send it along. See if I can crash the whole of Scotland.

Craig

Post Reply