directory

How can I copy a directory using Boost Filesystem

南笙酒味 提交于 2019-12-17 18:14:10
问题 How can I copy a directory using Boost Filesystem? I have tried boost::filesystem::copy_directory() but that only creates the target directory and does not copy the contents. 回答1: bool copyDir( boost::filesystem::path const & source, boost::filesystem::path const & destination ) { namespace fs = boost::filesystem; try { // Check whether the function call is valid if( !fs::exists(source) || !fs::is_directory(source) ) { std::cerr << "Source directory " << source.string() << " does not exist or

PHP: fopen to create folders

本小妞迷上赌 提交于 2019-12-17 18:12:57
问题 I need to know if there is any way to create new folder if the path doesn't exist. When I try to fopen() a path, it says NO such File or Directory exists I tried to open the file using 'w' and 'w+' but it is not able to create new folder. Is there any way to achieve it without using mkdir(). Because I need to extract the directory names alone from the path to mkdir() everytime. Any help is appreciated. Thanks... 回答1: fopen cannot create directories. You'll need to use something like:

Create a Directory in PhoneGap Application

纵饮孤独 提交于 2019-12-17 17:56:28
问题 Trying to figure out how to create a directory on the file system using PhoneGap. I want to create a directory for my PhoneGap application, so I can store images the user creates there and load them back up in the app. 回答1: This is how you do it : window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onRequestFileSystemSuccess, null); function onRequestFileSystemSuccess(fileSystem) { var entry=fileSystem.root; entry.getDirectory("example", {create: true, exclusive: false},

iOS: Can't save file to 'Application Support' folder, but can to 'Documents'

只谈情不闲聊 提交于 2019-12-17 17:38:15
问题 I can download and save a binary file to the 'Documents' folder with a custom name perfectly fine. If I just change the URL to the 'Application Support' folder instead of the 'Documents' folder, it fails to write to that URL saying it doesn't exist. Here's the URL construction code: - ( NSURL * ) getSaveFolder { NSURL * appSupportDir = nil; NSURL * appDirectory = nil; NSArray * possibleURLs = [[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory inDomains

Removing .svn files from all directories [duplicate]

吃可爱长大的小学妹 提交于 2019-12-17 17:37:55
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How do you remove Subversion control for a folder? Command line to delete matching files and directories recursively I recently converted my cvs repository to svn using cvs2svn and I recently noticed that every directory has a hidden folder called .svn. My current build script copies a lot of directories from my versioned resources directories and it ends up copying the .svn files. Is there anyway to make svn

How do i get a list of folders and sub folders without the files?

柔情痞子 提交于 2019-12-17 17:24:34
问题 I am trying to print a list of the folders and sub folders of a directory to a file. When I run dir /s/b/o:n > f.txt , I get a list of the files also. I only need the folders and sub folders. Anyone know is this possible to do this from command line interface? 回答1: Try this: dir /s /b /o:n /ad > f.txt 回答2: Displays a list of files and subdirectories in a directory. DIR [ drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:

Copy files from one directory into an existing directory

送分小仙女□ 提交于 2019-12-17 17:20:32
问题 In bash I need to do this: take all files in a directory copy them into an existing directory How do I do this? I tried cp -r t1 t2 (both t1 and t2 are existing directories, t1 has files in it) but it created a directory called t1 inside t2, I don't want that, I need the files in t1 to go directly inside t2. How do I do this? 回答1: What you want is: cp -R t1/. t2/ The dot at the end tells it to copy the contents of the current directory, not the directory itself. This method also includes

oracle数据泵

不打扰是莪最后的温柔 提交于 2019-12-17 17:10:53
–查看数据泵地址 select * from all_directories; –创建数据泵地址 create directory cs_lx as ‘/backup/lxx’; –授予用户读写权限 grant read,write on directory cs_lx to bbsp; –导出表 只倒表结构加(rows=n),不打印日志加上参数(nologfile=y) Expdp lxx/lxx directory=cs_lx dumpfile=lxx.dmp tables= CPPM_AUTHLIST_DATA,CPPM_BANK_DATA rows=n exp bbsp2/bbsp2@BEMS_49 file=E:\pzw\dmp\move_data_20171102.dmp tables=(ACCEPTIMPAWN,ACCEPTPLEDGE) 导入表 imp bbsp8/bbsp8@BEMS_49 fromuser=bbsp2 touser=bbsp8 ignore=y file=e:\init_data_20171102.dmp full=y impdp bbsp7/bbsp7 directory=cs_lx dumpfile=lxx.dmp parallel=4 remap_schema=bbsp2:bbsp7 –当前用户导出导入 expdp bbsp7/bbsp7

Batch file - Write list of files to variable

我怕爱的太早我们不能终老 提交于 2019-12-17 17:03:45
问题 I'd like to get a list of all files (including their absolute path) into a variable, separated by spaces. My Google-fu seems to be weak in this regard, because I keep running into issues. I have a base directory stored in %baseDir%, and would like to parse it for files (not recursing or including sub-directories). Like I mentioned, this needs to go into a list. I'd imagine there's a nice little shortcut I could use, but a for loop and concatenation would do the trick as well. Ideally, I'd

Unique Folder Identifier

余生长醉 提交于 2019-12-17 16:53:29
问题 Earlier today someone generously answered my question regarding the retrieval of a unique identifier associated with files on the computer. Unique File Identifier The solution worked great, however, it does not address unique identifiers for folders. How can I retrieve a UID for specified directories, UID's that will stay with the directory through renames and moves. Update: FSCTL_GET_OBJECT_ID seems like it is the function I am after, but would someone be able to provide brief context on the