/* -*-C-*-
-$Id: pros2fs.c,v 1.9 1995/10/28 00:57:02 cph Exp $
+$Id: pros2fs.c,v 1.10 1995/10/28 01:09:58 cph Exp $
Copyright (c) 1994-95 Massachusetts Institute of Technology
DEFINE_PRIMITIVE ("OS2-COPY-FILE", Prim_OS2_copy_file, 2, 2, 0)
{
PRIMITIVE_HEADER (2);
- STD_API_CALL (dos_copy, (STRING_ARG (1)), (STRING_ARG (2)), DCPY_EXISTING)
+ {
+ const char * from = (STRING_ARG (1));
+ const char * to = (STRING_ARG (2));
+ FILESTATUS3 * info = (OS2_read_file_status (to));
+ if ((info != 0) && (((info -> attrFile) & FILE_READONLY) != 0))
+ {
+ (info -> attrFile) &=~ FILE_READONLY;
+ OS2_write_file_status (to, info);
+ }
+ STD_API_CALL (dos_copy, from, to, DCPY_EXISTING);
+ }
PRIMITIVE_RETURN (UNSPECIFIC);
}