home *** CD-ROM | disk | FTP | other *** search
- /*
- ** f u n c s . c
- **
- ** functions for performing single operations
- **
- ** Arthur W. Neilson III
- ** art@bohtsg.pegasus.com
- ** Feb 7, 1990
- **
- */
-
- #include "main.h"
- #include "node.h"
-
- /*
- ** d e l
- **
- ** delete file
- **
- */
- Node *
- del(node)
- Node *node;
- {
- if (access(node->name, W_OK) == 0)
- if (execute(RM, RM, "-f", node->name, NULL) == 0) {
- if (--total == 0)
- quit(1);
- bytes -= node->st->st_size;
- if (node == tail)
- tail = node->prev;
- node = rmnode(node);
- }
- return (node);
- }
-
- /*
- ** p r i n t
- **
- ** print a file
- **
- */
- VOID
- lp(name)
- char *name;
- {
- if (access(name, R_OK) == 0) {
- execute(LP, LP, LPOPTS, name, NULL);
- }
- }
-