commands.cc
/*
** uncompress_file - uncompress the file at line y in the DirList.
**                   Update the window appropriately.
*/
uncompress the file at line y in the DirList.
Update the window appropriately.
uncompress the file at line y in the DirList . Update the window appropriately .
static void uncompress_file(DirList *dl, const char *file)
{
    String cmd = String("compress -d") + " " + file 
               + " 1>" + DEVNULL + " 2>&1";
    if (!system(cmd))
    {
        message("Uncompressing ... ");
        char *dot = strrchr(file, '.');
        *dot = 0;  
        String command = String(ls_cmd[the_sort_order()]) + file +
                         " 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 uncompress the file.  Hence we probably
             still have the .Z file lying around.
            update_current_line(dl, new_line);
        (void)pclose(fp);
        message("Uncompressing ... done");
    }
    else
        message("`uncompress' failed");
}
static void uncompress_file ( DirList * dl , const char * file ) { String cmd = String ( " " ) + " " + file + " " + DEVNULL + " " ; if ( ! system ( cmd ) ) { message ( " " ) ; char * dot = strrchr ( file , ' ' ) ; * dot = 0 ; 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 ( " " ) ; }
uncompress_file - uncompress the file at line y in the DirList.
uncompress_file - uncompress the file at line y in the DirList .
// remove .Z suffix // // 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 uncompress the file.  Hence we probably // still have the .Z file lying around. //