|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T c
Length: 1742 (0x6ce)
Types: TextFile
Names: »copy_f.c«
└─⟦8ee07855d⟧ Bits:30000545 8mm tape, Rational 1000, DTIA 2_1_6
└─⟦0c25cb74a⟧ »DATA«
└─⟦038380b96⟧
└─⟦d0624311f⟧ Bits:30000529 8mm tape, Rational 1000, DTIA 2_1_7
└─⟦f494b5154⟧ »DATA«
└─⟦038380b96⟧
└─⟦this⟧ »copy_f.c«
└─⟦8ee07855d⟧ Bits:30000545 8mm tape, Rational 1000, DTIA 2_1_6
└─⟦0c25cb74a⟧ »DATA«
└─⟦0732ea0cf⟧
└─⟦d0624311f⟧ Bits:30000529 8mm tape, Rational 1000, DTIA 2_1_7
└─⟦f494b5154⟧ »DATA«
└─⟦0732ea0cf⟧
└─⟦this⟧ »../../dtia/release_apollo_2.1/copy_f.c«
└─⟦8ee07855d⟧ Bits:30000545 8mm tape, Rational 1000, DTIA 2_1_6
└─⟦0c25cb74a⟧ »DATA«
└─⟦25fab149a⟧
└─⟦d0624311f⟧ Bits:30000529 8mm tape, Rational 1000, DTIA 2_1_7
└─⟦f494b5154⟧ »DATA«
└─⟦25fab149a⟧
└─⟦this⟧ »../../dtia/release_sun_2.1/copy_f.c«
└─⟦8ee07855d⟧ Bits:30000545 8mm tape, Rational 1000, DTIA 2_1_6
└─⟦0c25cb74a⟧ »DATA«
└─⟦be254d495⟧
└─⟦d0624311f⟧ Bits:30000529 8mm tape, Rational 1000, DTIA 2_1_7
└─⟦f494b5154⟧ »DATA«
└─⟦be254d495⟧
└─⟦this⟧ »../../dtia/release_aix_2.1/copy_f.c«
└─⟦8ee07855d⟧ Bits:30000545 8mm tape, Rational 1000, DTIA 2_1_6
└─⟦0c25cb74a⟧ »DATA«
└─⟦c67979795⟧
└─⟦d0624311f⟧ Bits:30000529 8mm tape, Rational 1000, DTIA 2_1_7
└─⟦f494b5154⟧ »DATA«
└─⟦c67979795⟧
└─⟦this⟧ »../../dtia/release_hp_2.1/copy_f.c«
#ifndef lint
#ifndef DEBUG
static char SCCS_id[] = "@(#)copy_f.c 2.1 90/08/02 19:04:38 Copyright(c) 1990 by Rational.";
#else
static char SCCS_id[] = "@(#)copy_f.c DEBUG 2.1 90/08/02 19:04:38 Copyright(c) 1990 by Rational.";
#endif
#endif
#define COPY_F
#include "talk.h"
#undef COPY_F
extern int errno;
static short is_link;
static int error_number = E_OK;
static get_inode(n) char *n;
{
struct stat buf;
int error;
error = stat(n,&buf);
if (error == -1) error_number = errno;
return (error == -1) ? -1 : buf.st_ino;
}
int copy_f_link_in(i) int i;
{
error_number = E_OK;
is_link = i;
return E_OK;
}
int copy_f_from_remote_file_in(str) char *str;
{
put_unix_name(str);
return E_OK;
}
int copy_f_to_remote_file_in(str) char *str;
{
int file_in,file_out;
int lg;
char *from;
int ino_from,ino_to;
get_unix_name(&from);
ino_from = get_inode(from);
ino_to = get_inode(str);
if (ino_from == -1) {
return E_OK;
}
error_number = E_OK;
if (is_link) {
if (link(from,str) == -1) error_number = errno;
} else {
#define LG_BUFFER 1000
char buffer[LG_BUFFER];
if (ino_from == ino_to) {
/* Copy to itself: nothing to do */
return E_OK;
}
file_in = open(from,O_RDONLY);
if (file_in == -1) {
error_number = errno;
return E_OK;
}
file_out = open(str,O_WRONLY|O_CREAT|O_TRUNC,0644);
if (file_out == -1) {
error_number = errno;
close(file_in);
return E_OK;
}
while ((lg=read(file_in,buffer,LG_BUFFER))>0) {
if (write(file_out,buffer,lg) == -1)
error_number = errno;
}
if (lg == -1) error_number = errno;
close(file_in);
close(file_out);
}
return E_OK;
}
int copy_f_options_in(options)
char *options;
{
return E_OK;
}
int copy_f_end() {
return error_number;
}