转自stackoverflow: http://stackoverflow.com/questions/115983/how-do-i-add-an-empty-directory-to-a-git-repository Another way to make a directory stay empty (in the repo) is to create a .gitignore inside that directory that contains two lines: 在空目录下创建.g…
第一次接触NodeJS的文件系统就被它的异步的响应给搞晕了,后来发现NodeJS判断文件夹是否存在和创建文件夹是还有同步方法的,但是还是想尝试使用异步的方法去实现. 使用的方法:fs.exists(path, callback);fs.mkdir(path, [mode], callback); 实现文件夹目录结构的创建代码实现如下: //创建文件夹 function mkdir(pos, dirArray,_callback){ var len = dirArray.length; conso…
import os,shutil def newDir(dir_path): if not os.path.exists(dir_path): os.makedirs(dir_path) def copydir(where_path,go_path,start_time,end_time): newDir(go_path) for brand in os.listdir(where_path): brand_path = os.path.join(where_path, brand) #prin…