/* -*-C-*-
-$Id: dosfs.c,v 1.4 1992/10/21 00:27:11 jinx Exp $
+$Id: dosfs.c,v 1.5 1995/11/06 21:51:03 cph Exp $
-Copyright (c) 1992 Massachusetts Institute of Technology
+Copyright (c) 1992-95 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
error_system_call (errno, syscall_rename);
}
+void
+DEFUN (OS_file_copy, (from_name, to_name),
+ CONST char * from_name AND
+ CONST char * to_name)
+{
+ int result;
+ Tchannel source_channel = (OS_open_input_file (from_name));
+ Tchannel destination_channel = (OS_open_output_file (to_name));
+ off_t source_length = (OS_file_length (source_channel));
+
+ result = (OS_channel_copy (source_length,
+ source_channel,
+ destination_channel));
+
+ OS_channel_close (source_channel);
+ OS_channel_close (destination_channel);
+
+ if (result < 0)
+ {
+ signal_error_from_primitive (ERR_IO_ERROR);
+ }
+ return;
+}
+
void
DEFUN (OS_directory_make, (name), CONST char * name)
{
/* -*-C-*-
-$Id: os2fs.c,v 1.6 1995/10/23 06:16:20 cph Exp $
+$Id: os2fs.c,v 1.7 1995/11/06 21:51:37 cph Exp $
Copyright (c) 1994-95 Massachusetts Institute of Technology
OS2_error_unimplemented_primitive ();
}
+void
+OS_file_copy (const char * from, const char * to)
+{
+ 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, (((PSZ) from), ((PSZ) to), DCPY_EXISTING));
+}
+
void
OS_directory_make (const char * directory_name)
{
/* -*-C-*-
-$Id: pros2fs.c,v 1.14 1995/11/06 21:50:55 cph Exp $
+$Id: pros2fs.c,v 1.15 1995/11/06 21:52:24 cph Exp $
Copyright (c) 1994-95 Massachusetts Institute of Technology
extern char * OS2_drive_type (char);
extern long OS2_timezone (void);
extern long OS2_daylight_savings_p (void);
+extern void EXFUN (OS_file_copy, (CONST char *, CONST char *));
#ifndef FILE_TOUCH_OPEN_TRIES
#define FILE_TOUCH_OPEN_TRIES 5
/* -*-C-*-
-$Id: prosfs.c,v 1.11 1992/10/21 00:27:22 jinx Exp $
+$Id: prosfs.c,v 1.12 1995/11/06 21:52:33 cph Exp $
Copyright (c) 1987-1992 Massachusetts Institute of Technology
(off_t source_length,
Tchannel source_channel,
Tchannel destination_channel));
+extern void EXFUN (OS_file_copy, (CONST char *, CONST char *));
#define STRING_RESULT(expression) \
{ \
return (0);
}
-void
-DEFUN (OS_file_copy, (from_name, to_name),
- CONST char * from_name AND
- CONST char * to_name)
-{
- int result;
- Tchannel source_channel = (OS_open_input_file (from_name));
- Tchannel destination_channel = (OS_open_output_file (to_name));
- off_t source_length = (OS_file_length (source_channel));
-
- result = (OS_channel_copy (source_length,
- source_channel,
- destination_channel));
-
- OS_channel_close (source_channel);
- OS_channel_close (destination_channel);
-
- if (result < 0)
- {
- signal_error_from_primitive (ERR_IO_ERROR);
- }
- return;
-}
-
DEFINE_PRIMITIVE ("FILE-COPY", Prim_file_copy, 2, 2,
"Make a new copy of the file FROM-NAME, called TO-NAME.")
{
/* -*-C-*-
-$Id: uxfs.c,v 1.9 1992/10/21 00:26:46 jinx Exp $
+$Id: uxfs.c,v 1.10 1995/11/06 21:51:12 cph Exp $
-Copyright (c) 1990-1992 Massachusetts Institute of Technology
+Copyright (c) 1990-95 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
return (0);
#endif
}
-\f
+
int
DEFUN (OS_file_access, (name, mode), CONST char * name AND unsigned int mode)
{
))
UX_unlink (name);
}
-
+\f
void
DEFUN (OS_file_link_hard, (from_name, to_name),
CONST char * from_name AND
STD_VOID_SYSTEM_CALL (syscall_rename, (UX_rename (from_name, to_name)));
}
+void
+DEFUN (OS_file_copy, (from_name, to_name),
+ CONST char * from_name AND
+ CONST char * to_name)
+{
+ int result;
+ Tchannel source_channel = (OS_open_input_file (from_name));
+ Tchannel destination_channel = (OS_open_output_file (to_name));
+ off_t source_length = (OS_file_length (source_channel));
+
+ result = (OS_channel_copy (source_length,
+ source_channel,
+ destination_channel));
+
+ OS_channel_close (source_channel);
+ OS_channel_close (destination_channel);
+
+ if (result < 0)
+ {
+ signal_error_from_primitive (ERR_IO_ERROR);
+ }
+ return;
+}
+
void
DEFUN (OS_directory_make, (name), CONST char * name)
{