Go to main content

valid

Use to validate a file or a directory.

VALID

NAME

valid - Use to validate a file or a directory.

SYNOPSIS

valid("filename");

DESCRIPTION

This function is used to validate a file or a directory. A file is valid if its below the root of the filesystem and can be stats.

The root of the filesystem is defined in the configuration file. See ExtensoConfig for more information.

False positive

If you put an absolute path, it will always return `true` even though it is not!  

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

// Normal example
valid("/../../v5/html"); 
// returns `false` if it does not exists, `true` if it does. 

// False positive
valid("/usr/local/website/my_site/whatever/bad/path");
// returns `true` even though this path is invalid!

SEE ALSO

{{ include("includes/files.sn") }}

AUTHOR

Written by Pierre Laplante, <laplante@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.