VirtualBox

Changeset 2096 in kBuild


Ignore:
Timestamp:
Nov 20, 2008 2:18:06 AM (16 years ago)
Author:
bird
Message:

kmk: if exists some-file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/expreval.c

    r2022 r2096  
    877877
    878878/**
     879 * Does file(/dir/whatever) exist, unary.
     880 *
     881 * @returns Status code.
     882 * @param   pThis       The instance.
     883 */
     884static EXPRRET expr_op_exists(PEXPR pThis)
     885{
     886    PEXPRVAR            pVar = &pThis->aVars[pThis->iVar];
     887    struct stat         st;
     888
     889    expr_var_make_simple_string(pVar);
     890    expr_var_assign_bool(pVar, stat(pVar->uVal.psz, &st) == 0);
     891
     892    return kExprRet_Ok;
     893}
     894
     895
     896/**
    879897 * Is target defined, unary.
    880898 *
     
    15781596    /*        Name, iPrecedence,  cArgs,    pfn    */
    15791597    EXPR_OP("defined",     90,      1,    expr_op_defined),
     1598    EXPR_OP("exists",      90,      1,    expr_op_exists),
    15801599    EXPR_OP("target",      90,      1,    expr_op_target),
    15811600    EXPR_OP("bool",        90,      1,    expr_op_bool),
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette