newdir-创建文件夹

仅X2、X3、X5系列支持

newdir dir

dir:文件夹目录(:"sd0/newfolder/")

newdir-示例1

1 //在SD卡根目录中创建一个名称为a的子目录
2 newdir "sd0/a/"
../_images/newdir_1.jpg

newdir-示例2

1 //在SD卡根目录中创建一个名称为picture的子目录
2 newdir "sd0/picture/"
../_images/newdir_2.jpg

newdir-示例3

1 //在SD卡根目录中创建一个名称为picture的子目录
2 t0.txt="sd0/picture/"
3 newdir t0.txt
../_images/newdir_3.jpg

请保证t0的txt_maxl足够大,否则会提示操作文件失败。

注意

内存文件系统不支持子目录,SD卡支持子目录,目录路径必须以”/”结尾。

在创建或文件夹前请先使用finddir指令检查该文件夹是否存在。

在某个文件夹下创建子文件夹,需保证父文件夹已存在。

newdir指令-样例工程下载

资源合集汇总