commands.cc
/*
** chgrp_file - change the group of the current file.
**              Update the window appropriately.
*/
change the group of the current file.
Update the window appropriately.
change the group of the current file . Update the window appropriately .
static void chgrp_file(DirList *dl, const char *file, const char *group)
{
    const char *chgrp  = "chgrp";
    const char *args[4];
    args[0] = chgrp; args[1] = group; args[2] = file; args[3] = 0;
    if (execute(chgrp, args))
    {
        String command = ls_cmd[the_sort_order()];
        if (is_directory(file)) command += "-d";
        command += String(" ") + file;
        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 == 0)
            error("File %s, line %d: fgetline() failed", __FILE__, __LINE__);
        (void)pclose(fp);
        update_current_line(dl, new_line);
    }
    else
        message("`chgrp' failed");
}
static void chgrp_file ( DirList * dl , const char * file , const char * group ) { const char * chgrp = " " ; const char * args [ 4 ] ; args [ 0 ] = chgrp ; args [ 1 ] = group ; args [ 2 ] = file ; args [ 3 ] = 0 ; if ( execute ( chgrp , args ) ) { String command = ls_cmd [ the_sort_order ( ) ] ; if ( is_directory ( file ) ) command += " " ; command += String ( " " ) + file ; FILE * fp = popen ( command , " " ) ; if ( fp == 0 ) error ( " " , __FILE__ , __LINE__ , ( const char * ) command ) ; char * new_line = fgetline ( fp ) ; if ( new_line == 0 ) error ( " " , __FILE__ , __LINE__ ) ; ( void ) pclose ( fp ) ; update_current_line ( dl , new_line ) ; } else message ( " " ) ; }
chgrp_file - change the group of the current file.
chgrp_file - change the group of the current file .