[m-rev.] for review: library changes for `mmc --make' on Windows

Simon Taylor stayl at cs.mu.OZ.AU
Sun Jul 20 01:33:55 AEST 2003


On 15-Jul-2003, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 15-Jul-2003, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > +io__check_file_accessibility_dotnet(FileName, AccessTypes, Result, !IO) :-
> > +	CheckRead0 = pred_to_bool(access_types_includes_read(AccessTypes)),
> > +	CheckWrite = pred_to_bool(access_types_includes_write(AccessTypes)),
> > +
> > +	CheckExec = pred_to_bool(access_types_includes_execute(AccessTypes)),
> > +	% We need to be able to read a file to execute it.
> > +	CheckRead = bool__or(CheckRead0, CheckExec),
> >  
> > -").
> > +	io__file_type(yes, FileName, FileTypeRes, !IO),
> > +	(
> > +		FileTypeRes = ok(FileType),
> > +		( FileType = directory ->
> > +			check_directory_accessibility_dotnet(FileName,
> > +				to_int(CheckRead), to_int(CheckWrite),
> > +				Result, !IO)
> > +		;
> > +			( CheckRead = yes ->
> > +				io__open_input(FileName, InputRes, !IO),
> > +				(
> > +					InputRes = ok(InputStream),
> > +					io__close_input(InputStream, !IO),
> > +					CheckReadRes = ok
> > +				;
> > +					InputRes = error(InputError),
> > +					CheckReadRes = error(InputError)
> > +				)
> > +			;
> > +				CheckReadRes = ok
> > +			),
> > +			( CheckReadRes = ok, CheckWrite = yes ->
> > +				io__open_append(FileName, OutputRes, !IO),
> > +				(
> > +					OutputRes = ok(OutputStream),
> > +					io__close_output(OutputStream, !IO),
> > +					CheckWriteRes = ok
> > +				;
> > +					OutputRes = error(OutputError),
> > +					CheckWriteRes = error(OutputError)
> > +				)
> > +			;
> > +				CheckWriteRes = CheckReadRes
> > +			),
> > +			(
> > +				CheckWriteRes = ok,
> > +
> > +				% Unix programs need to check whether the
> > +				% execute bit is set for the directory, but
> > +				% we can't actually execute the directory.
> > +				FileType \= directory,
> > +				CheckExec = yes
> 
> This code is already in the FileType \= directory case of the containing
> if-then-else, so I don't see the point of duplicating that check here.

--- io.m	2003/07/19 15:30:18	1.1
+++ io.m	2003/07/19 15:31:21
@@ -2679,7 +2679,6 @@
 				% Unix programs need to check whether the
 				% execute bit is set for the directory, but
 				% we can't actually execute the directory.
-				FileType \= directory,
 				CheckExec = yes
 			->
 				have_dotnet_exec_permission(Result, !IO)
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list