Number: 1444

Date: 14-Jun-84 16':52':07

Submitter: Sannella.PA

Source: Masinter

Subject: Resolve confusion over OUTFILEP

Assigned To: 

Attn: LispCore↑

Status: Open

In/By: 

Problem Type: Documentation

Impact: Moderate

Difficulty: Moderate

Frequency: 

Priority: Unlikely

System: Operating System

Subsystem: Generic File Operations

Machine: 

Disk: 

Lisp Version: 

Source Files: 

Microcode Version: 

Memory Size: 

File Server: 

Server Software Version: 

Disposition: '
["Masinter" "21-Aug-84 10':12':57" Description':]'
["Masinter" "21-Aug-84 14':00':42" Description':]'
["Sannella.PA" "27-Aug-84 16':56':44" Description':]'
["masinter" "12-Sep-84 12':58':53" Subject': Attn': Description':]

Description: [It doesn''t seem like there is consensus. My latest vote (lmm) is for a function that does what bill suggests (do INFILEP, add 1 to version if it exists and else return name;1) for devices that don''t know any better, and more for versions that do. Another "generic" definition I''ve seen people write is (if (NLSETQ (SETQ OFP (OPENFILE file ''OUTPUT ''NEW))) then '
      (DELFILE (CLOSEF OFP))]'
'
i.e., they actually create the file, close it and delete it. Crufty, eh?'
'
]'
'
Date':  7 Jun 84 17':16':39 PDT (Thursday)'
From': Masinter.PA'
Subject': AR#1108 -- OUTFILEP X TO FLOPPY RETURN NIL FOR ALL X'
To': Roach'
cc': LispCore↑, LispSupport'
'
Kelly, I''ve taken my name off AR#1108.'
'
Folks, I think this is a general problem with a number of our file devices, namely that OUTFILEP returns NIL most of the time (This was detected with CORE devices at one time, was it not?)'
'
I think its a candidate test to be included in the ''device exerciser'' diagnostic. Is that on DSKTEST? Or FILEBANGER?'
'
-----'
'
Date':  7 Jun 84 17':25 PDT'
From': vanMelle.pa'
Subject': Re': AR#1108 -- OUTFILEP X TO FLOPPY RETURN NIL FOR ALL X'
In-reply-to': Masinter.PA''s message of 7 Jun 84 17':16':39 PDT (Thursday)'
To': Masinter.PA'
cc': Roach.PA, LispCore↑.PA, LispSupport.PA'
'
Personally, I''d rather dedocument the function.  Seems to me we had a long discussion about the uselessness of this function last year (grumble, the things we have to support because Tenex provided it for free).  It is my belief that we do not have any device which could do it substantially more cheaply or effectively than a generic function that was defined as being (INFILEP name) with version incremented by one, or name;1 if it came back NIL.'
'
	Bill'
'
-----'
'
Date':  7 Jun 84 19':34 PDT'
From': JonL.pa'
Subject': Re': AR#1108 -- OUTFILEP X TO FLOPPY RETURN NIL FOR ALL X'
In-reply-to': vanMelle.pa''s message of 7 Jun 84 17':25 PDT'
To': vanMelle.pa'
cc': Masinter.PA, Roach.PA, LispCore↑.PA, LispSupport.PA'
'
Remember, I''ve been bitten by the "feature" that (INFILEP x) ==> T doesn''t necessarily mean that the file is "there".  I suspect that there is a race condition with OUTFILEP of a similar nature.  '
'
The more odious "fix" would be to NLSETQ a clause which actually openend the file for output; but this also implies that asking OUTFILEP without actually geting back an Open-File pointer is an ill-conceived operation.'
'
-- JonL --'
'
-----'
'
Date': 20 AUG 84 23':38 PDT'
From': MASINTER.PA'
Subject': AR#1444, flush OUTFILEP'
To':   LispSupport'
cc':   vanMelle, Kaplan'
'
I think this should be marked DECLINED. We should note (in the manual and release notes) that some devices do not support OUTFILEP and return NIL even though OUTFILE would succeed; callers should take OUTFILEP as a ''hint'' that OUTFILE of the given name would likely complete to the returned value.'
'
I do not believe there are any callers of OUTFILEP in the system, but I have seen it in *many* user''s code ...'
'
-----'
'
'
Date': 20 Aug 84 23':41 PDT'
From': acuff.pa'
Subject': Re': AR#1444, flush OUTFILEP'
In-reply-to': MASINTER.PA''s message of 20 AUG 84 23':38 PDT'
To': MASINTER.PA'
cc': LispSupport.PA, vanMelle.PA, Kaplan.PA'
'
   Just to make sure nobody forgets it, I''ll point out that most of the time when one uses something like OUTFILEP or INFILEP what one really wants is a decent exception handling mechanism.'
'
	-- Rich'
'
-----'
'
From': masinter.pa'
Date': 21-Aug-84  0':21':43 PDT'
Subject': Re': AR#1444, flush OUTFILEP'
In-reply-to': acuff''s message of 20 Aug 84 23':41 PDT'
To': acuff'
cc': MASINTER, LispSupport, vanMelle, Kaplan'
'
the uses I saw were cases like,'
'
(printout T "I''m gonna write file " (OUTFILEP X) "; is that OK?" T)'
'
kind of stuff'
'
not exception handling at all.'
'
Another use in a function tht took a file name '
'
-----'
'
Date': 21 Aug 84 11':40 PDT'
From': acuff.pa'
Subject': Re': AR#1444, flush OUTFILEP'
In-reply-to': masinter.pa''s message of 21-Aug-84  0':21':43 PDT'
To': masinter.pa'
cc': acuff.pa, LispSupport.pa, vanMelle.pa, Kaplan.pa'
'
   So you''re saying that people are using OUTFILEP and INFILEP for recognition, not really as predicates?'
'
	-- Rich'
'
-----'
Date': 21 Aug 84 11':48 PDT'
From': Masinter.pa'
Subject': Re': AR#1444, flush OUTFILEP'
In-reply-to': acuff.pa''s message of 21 Aug 84 11':40 PDT'
To': acuff.pa'
cc': masinter.pa, LispSupport.pa, vanMelle.pa, Kaplan.pa'
'
well, INFILEP is used as a predicate (OR (INFILEP file) look for another file). OUTFILEP is used more for recognition, in the cases that I''ve seen'
'
-----'
'
Date': 21 Aug 84 13':02 PDT'
From': acuff.pa'
Subject': Re': AR#1444, flush OUTFILEP'
In-reply-to': Masinter.pa''s message of 21 Aug 84 11':48 PDT'
To': Masinter.pa'
cc': acuff.pa, LispSupport.pa, vanMelle.pa, Kaplan.pa'
'
   In both cases (predicate and recog) it seems that an execption handling mechanism would be helpful.  When one wants a predicate, an exception oriented structure would seem to fit, as well as buy some efficiency, since INFILEP can be pretty expensive when it has to be pretty much done twice over potentially slow devices.  In the recog case for OUTFILEP, if you assume that most of the time when recog is done writing is soon to follow it might make sense to open the file for write (potentially failing, but in a handleable way), and use the FULLFILENAME, aborting the write in the few cases where it turns out that the file isn''t to be written.'
'
   I make these arguments mostly because I''d like to see a flexible exception handling/signal mechanism in Interlisp-D.  I imagine that there is an AR already about this (if there isn''t, I request that one be made), but that nothing will/can be done for some time.  However, I''d still like to keep the topic in the backs of people''s minds.'
'
	-- Rich'
'
-----'
'
Date': 21 Aug 84 18':35 PDT'
From': JonL.pa'
Subject': Re': AR#1444, flush OUTFILEP'
In-reply-to': Masinter.pa''s message of 21 Aug 84 11':48 PDT'
To': Masinter.pa'
cc': acuff.pa, LispSupport.pa, vanMelle.pa, Kaplan.pa'
'
Nice in theory, but this mode doesn''t work.  (INFILEP X) being true unfortunately doesn''t mean that you can do (OPENFILE X ''INPUT).  Ask Bill to elaborate on the particulars.'
'
-- JonL --'
'
P.S.  I''ve had to give up using either INFILEP or OUTFILEP, and simply do a lot of careful NLSETQing around OPENFILEs.'
'
'


Workaround: 

Test Case: 

Edit-By: masinter

Edit-Date: 12-Sep-84 12':58':55