diff --git a/interfaces/kits/js/src/mod_fs/properties/listfile.cpp b/interfaces/kits/js/src/mod_fs/properties/listfile.cpp index e046e174517d0d2fb836b0c6b712efc23adc7655..6906f8e5211589fe578268562b20d3a60599938e 100755 --- a/interfaces/kits/js/src/mod_fs/properties/listfile.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/listfile.cpp @@ -151,7 +151,7 @@ static bool GetOptionArg(napi_env env, const NFuncArg &funcArg, OptionArgs &opti static bool FilterSuffix(const vector &suffixs, const struct dirent &filename) { - if (filename.d_type == DT_DIR) { + if (filename.d_type == DT_DIR && g_optionArgs.recursion) { return true; } size_t found = string(filename.d_name).rfind('.');