Check if file is in (sub)directory

前端 未结 8 948
醉梦人生
醉梦人生 2021-01-04 05:50

I would like to check whether an existing file is in a specific directory or a subdirectory of that.

I have two File objects.

File dir;
File file;
<         


        
8条回答
  •  情话喂你
    2021-01-04 06:06

    If you plan to works with file and filenames heavly check apache fileutils and filenameutils libraries. Are full of useful (and portale if portability is mamdatory) functions

提交回复
热议问题