<number> = Numeric functions: existsexists <variable>
<number> = Numeric functions: existsexists Text functions: file Instructions: filefile <path>
<number> = Numeric functions: existsexists List functions: dir Instructions: dir Shell Immediate Commands: dirdir <path>
<number> = Numeric functions: existsexists Text functions: link Instructions: linklink <path>
Test whether a Glossary: Variable, var_refvariable, Text functions: file Instructions: filefile, List functions: dir Instructions: dir Shell Immediate Commands: dirdir Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or Text functions: link Instructions: linklink Numeric functions: existsexists.
Flow control: returnReturns a numeric Glossary: Valuevalue, which is either 1 (true) Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or 0 (false).
When testing for a Glossary: Variable, var_refvariable, Flow control: if … then Flow control: try … thenthe Glossary: Variable, var_refvariable path may be completely broken, as long as Flow control: if … then Flow control: try … thenthe overall syntax of Flow control: if … then Flow control: try … thenthe Glossary: Variable, var_refvariable Vipsi command syntax: Expressions Glossary: Expressionexpression is ok. Flow control: if … then Flow control: try … thenThe result will probably be 'false' Flow control: if … then Flow control: try … thenthen.
When testing for Text functions: file Instructions: filefiles, directories Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Text functions: link Instructions: linklinks, Flow control: if … then Flow control: try … thenthe path must be a Glossary: text, text_valtext value Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and may be a full Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or partial path Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or start with "~" for Flow control: if … then Flow control: try … thenthe user's home directory. Symbolic Text functions: link Instructions: linklinks are followed, except Flow control: if … then Flow control: try … thenthe last path component which is Operators: Bitwise Not "~" Operators: Boolean Negation "!"not followed when testing for a Text functions: link Instructions: linklink. Flow control: if … then Flow control: try … thenThe path may be entirely broken, Operators: Bitwise Not "~" Operators: Boolean Negation "!"not even Flow control: if … then Flow control: try … thenthe first path component is required to Numeric functions: existsexist. Flow control: if … then Flow control: try … thenThe result will probably be 'false' Flow control: if … then Flow control: try … thenthen.
Shell Scripts: Return values Appendix: Return valuesReturn values of Numeric functions: existsexists Text functions: file Instructions: filefile:
Shell Scripts: Return values Appendix: Return valuesReturn values of Numeric functions: existsexists List functions: dir Instructions: dir Shell Immediate Commands: dirdir:
Shell Scripts: Return values Appendix: Return valuesReturn values of Numeric functions: existsexists Text functions: link Instructions: linklink:
*) as of version 0.8.7. Will probably be changed, so that Numeric functions: existsexists Flow control: returnreturns 'true' whever Operators: Make Identifier "@"at Flow control: if … then Flow control: try … thenthe target position is already an item, which prevents Instructions: newnew from succeeding. After a 'true' result you can test with Numeric functions: isfileisfile, Numeric functions: isdirisdir Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and Numeric functions: islinkislink for Flow control: if … then Flow control: try … thenthe actual Text functions: file Instructions: filefile type.
As with all Vipsi command syntax: Functions Functions Glossary: Functionfunctions which accept exactly one Vipsi command syntax: Arguments Glossary: Argumentsargument Flow control: if … then Flow control: try … thenthe Separators: Round brackets "( … )" Functions with varying return types: bracket expression "()"parenthesis are optional Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and may be omitted Flow control: if … then Flow control: if … thenif the Vipsi command syntax: Arguments Glossary: Argumentsargument is no Vipsi command syntax: Expressions Glossary: Expressionexpression with Vipsi command syntax: Operators Operators Glossary: Operatoroperators.
e.g.:
vipsi> Instructions: var How does VScript::Value() work?: Var*&var a={1,2,3};
vipsi> Numeric functions: existsexists a[3] = 1
vipsi> Numeric functions: existsexists(a[5]) = 0
vipsi> Numeric functions: existsexists List functions: dir Instructions: dir Shell Immediate Commands: dirdir "/" 1
vipsi> Numeric functions: existsexists Text functions: file Instructions: filefile "/etc/fstab" 1
vipsi> Numeric functions: existsexists Text functions: link Instructions: linklink "~/foobär" 0
vipsi> Text functions: link Instructions: linklink "zz" = "/"
vipsi> Numeric functions: existsexists Text functions: link Instructions: linklink "zz" 1
vipsi> Numeric functions: existsexists Text functions: link Instructions: linklink Text functions: fullpathfullpath "zz" 0
vipsi> Numeric functions: existsexists List functions: dir Instructions: dir Shell Immediate Commands: dirdir Text functions: fullpathfullpath "zz" 1
vipsi>
|