Short name and long name

Richard Gaskin ambassador at fourthworld.com
Fri May 28 18:23:16 EDT 2010


Marty Knapp wrote:

> Let's say a user creates a stack from one of my templates, then later in
> the Finder, changes its name. Now there's a discrepancy between the
> short name and the long name. Is that a problem or does Rev understand
> this? Or should I construct a routine to parse the file name out and set
> the name to correct for this?

What happened when you tried it?

It's a quick test:

1. Make a stack
2. Save it
3. In the Finder/Explorer, change the name of the file
4. Save it again

When I tested it here I got the result I expected given that the stack's 
understanding of its file name is what's stored in its fileName property 
which is initialized when the stack opens:

If the name of a stack file is changed while the stack is open, that 
change is ignored when the engine saves, writing it instead to the name 
as it last understood it to be.

Where things can go wonky is when a user changes the name of a folder in 
that path - then the engine won't be able to write to the original 
filename because it can't find the path to do it.

When file I/O errors happen you can check the sysError function for 
details.  The function isn't all that helpful in itself, returning only 
the system error ID for what happened, but if you keep a table of those 
handy you can write meaningful messages to users or at the very least 
include the result from sysError in your error dialogs so if your user 
calls for support you can look it up then.

Here's some:

Win:
<http://msdn.microsoft.com/en-us/library/ms681382%28VS.85%29.aspx>

OS X:
<http://support.apple.com/kb/ht1618>

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv



More information about the Use-livecode mailing list