commands.cc
/*
** compress_file - compress the current file and update the window.
*/
compress the current file and update the window.
compress the current file and update the window .
static void compress_file(DirList *dl, const char *file)
{
    String cmd = String("compress") + " -f " + file + " 1>" + DEVNULL + " 2>&1";
    if (!system(cmd))
    {
        message("Compressing ... ");
        String command = String(ls_cmd[the_sort_order()]) + file +
                         ".Z 2>" + DEVNULL;
        FILE *fp = popen(command, "r");
        if (fp == 0)
            error("File %s, line %d: popen(%s) failed",
                  __FILE__, __LINE__, (const char *)command);
        char *new_line = fgetline(fp);
        if (new_line)
             Only update the line if we were able to read the line.
             Some versions of compress don\'t properly return a failure
             code if they don\'t compress the file.  Hence we probably
             still have the uncompressed file lying around.
            update_current_line(dl, new_line);
        (void)pclose(fp);
        message("Compressing ... done");
    }
    else
        message("`compress' failed");
}
static void compress_file ( DirList * dl , const char * file ) { String cmd = String ( " " ) + " " + file + " " + DEVNULL + " " ; if ( ! system ( cmd ) ) { message ( " " ) ; String command = String ( ls_cmd [ the_sort_order ( ) ] ) + file + " " + DEVNULL ; FILE * fp = popen ( command , " " ) ; if ( fp == 0 ) error ( " " , __FILE__ , __LINE__ , ( const char * ) command ) ; char * new_line = fgetline ( fp ) ; if ( new_line ) update_current_line ( dl , new_line ) ; ( void ) pclose ( fp ) ; message ( " " ) ; } else message ( " " ) ; }
compress_file - compress the current file and update the window.
compress_file - compress the current file and update the window .
// // Only update the line if we were able to read the line. // Some versions of compress don\'t properly return a failure // code if they don\'t compress the file.  Hence we probably // still have the uncompressed file lying around. //