[comp.sys.mac.programmer] How do you over-ride the SFGetFile Warning?

time@tbomb.ice.com (Tim Endres) (09/27/90)

I have a case where a user is selecting a file for appending data.
Unfortunately, SFGetFile always asks "Replace existing ...."!

Is there any documented means of over-riding this warning?
Can it be done via the filter procedure?

-------------------------------------------------------------
Tim Endres                |  time@ice.com
ICE Engineering           |  uunet!ice.com!time
8840 Main Street          |
Whitmore Lake MI. 48189   |  (313) 449 8288

russotto@eng.umd.edu (Matthew T. Russotto) (09/28/90)

In article <b.GRHXFE@tbomb.ice.com> time@tbomb.ice.com writes:
>
>I have a case where a user is selecting a file for appending data.
>Unfortunately, SFGetFile always asks "Replace existing ...."!
>
>Is there any documented means of over-riding this warning?
>Can it be done via the filter procedure?

You aren't using SFGetFile, you are using SFPutFile.  If you use SFGetFile,
you shouldn't have any such problem.

--
Matthew T. Russotto	russotto@eng.umd.edu	russotto@wam.umd.edu
      .sig under construction, like the rest of this campus.

tim@hoptoad.uucp (Tim Maroney) (10/01/90)

In article <b.GRHXFE@tbomb.ice.com> time@tbomb.ice.com writes:
>>I have a case where a user is selecting a file for appending data.
>>Unfortunately, SFGetFile always asks "Replace existing ...."!
>>
>>Is there any documented means of over-riding this warning?
>>Can it be done via the filter procedure?

In article <1990Sep27.174124.20713@eng.umd.edu> russotto@eng.umd.edu
(Matthew T. Russotto) writes:
>You aren't using SFGetFile, you are using SFPutFile.  If you use SFGetFile,
>you shouldn't have any such problem.

I'm sure Mr. Endres is thanking you for this helpful message.

Yes, it can be overridden.  One way to do it is to provide your own
ALRT with the same ID in your resource file, and mark it as not coming
up on alert stage n (where n = 0...3) using the usual ALRT flags.  Then
you can control whether it comes up or not by setting the alert stage
in either of the Standard File filters.  This is fairly kosher,
although unfortunately there is no ROM routine for writing the contents
of the low-memory global ACount.  If you just want to disable the
warning all the time, make your ALRT vanish for stage 0 and call
ResetAlrtStage in your filters -- or just disable it for all four
stages!

Note:  disabling this feature may cause the user to lose data in an
unexpected way.  Sometimes, though, it is a blessing -- as it would be
in the Build Application command in either of the Symantec compilers.
-- 
Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com

"I am convinced that cross-posting is an evil Satanic plot."
    -- Eugene Miya on soc.net-people, misc.headlines, misc.kids, misc.misc,
		      news.misc, and soc.misc

philip@pescadero.Stanford.EDU (Philip Machanick) (10/02/90)

In article <12600@hoptoad.uucp>, tim@hoptoad.uucp (Tim Maroney) writes:
|> In article <b.GRHXFE@tbomb.ice.com> time@tbomb.ice.com writes:
|> >>I have a case where a user is selecting a file for appending data.
|> >>Unfortunately, SFGetFile always asks "Replace existing ...."!
|> >>
|> >>Is there any documented means of over-riding this warning?
|> >>Can it be done via the filter procedure?
|> 
|> In article <1990Sep27.174124.20713@eng.umd.edu> russotto@eng.umd.edu
|> (Matthew T. Russotto) writes:
|> >You aren't using SFGetFile, you are using SFPutFile.  If you use SFGetFile,
|> >you shouldn't have any such problem.
|> 
|> I'm sure Mr. Endres is thanking you for this helpful message.
|> 
Actually, I think this _is_ the correct way - if you are _appending_ to an
existing file, you want to select its name from a list of existing files, not
type it in as a new name.
-- 
Philip Machanick
philip@pescadero.stanford.edu