I have files that i want to add to svn that are inside a number of nested sub folders. All the subfolder tree is still unversioned.
Say i want to version file1 and file2 (but not file 3) inside subsubfolder and no other file inside subfolder (i.e. file0).
The current filesystem is as follows
trunk
|--subfolder
|--file0
|--subsubfolder
|--file1
|--file2
|--file3
Trunk is versioned, subfolder and subsubfolder are not versioned.
svn add /subfolder/subsubfolder/file1
gives
svn: warning: W155010: The node 'trunk/subfolder/subsubfolder' was not found.
svn: E200009: Could not add all targets because some targets don't exist
svn: E200009: Illegal target for the requested operation
I wonder if there is a quick, potentially one-liner, command to add those files instead of going through adding all the subfolders along the way (without adding their content) and then finally adding the files.
Use the --parents option. Here is an example:
svn add --parents /subfolder/subsubfolder/file1
Related
If the beginning of my cloc --vcs git output is something like the following:
1826 text files.
1780 unique files.
384 files ignored.
Question 1: Is there a way to get a list of all the files ignored by the cloc command?
Also, if I instead run cloc "repo_name", it shows a completely different number of files.
2106 text files.
1981 unique files.
346 files ignored.
Question 2: How can I get a list of which files are being skipped when running the --vcs command?
#1, Ref. the --ignored switch in the documentation (either at https://github.com/AlDanial/cloc or via cloc --help):
--ignored=<file> Save names of ignored files and the reason they
were ignored to <file>.
#2, --vcs git uses git ls-files to get the list of files to count. Without this, cloc does a recursive search in the given directory. If only a subset of files in "repo_name" are under git control, or if you have entries in .gitignore, the two methods of getting file names will differ. This is also explained in the documentation.
git ls-files --other
will show files that aren't under git control.
I'm trying to move a bunch of folders from directory A to directory B.
The folders I would like to move have .csvs and .jps inside.
Directory A contains the following files that must remain in directory A (bat, cmd, py, csv, txt). Basically, all subdirectories of Source directory go, while all files stay. Not sure how everyone else would do this?
Visually it looks like this
Directory A
-Folder 1 (to be moved)
-Folder 2 (to be moved)
-Folder 3 (to be moved)
-Folder 4 (to be moved)
-cmd files
-python scripts
-csv files
-bat scripts
My code is below. It fails to move anything returns the following error:
Error 32 - 'Deleting Source Directory' is being used by another process (must be the batch script doing the command below). I'm glad it fails because I don't want to delete the source directory, I want to delete the subdirectories within the source directory. Any ideas?
robocopy /move SOURCE_DIR DESTINATION_DIR /XF *.cmd* *.log* *.py* *.csv* *.bat*
Should I make this a two command script instead? First one copies the subdirectories, and the second deletes them?
I have a Directory with many sub-directories in it including one named as OLD. This OLD folder could also be inside any of the sub directories and contains archived files.
Root Directory A
SUB-DIRECTORY A
file1.txt
file2.txt
SUB-DIRECTORY B
file1.txt
file2.txt
OLD
SUB-DIRECTORY C
file1.txt
file2.txt
SUB-DIRECTORY D
file1.txt
OLD
SUB-SUB-DIRECTORY E
file7.txt
OLD
I need to create a job in Talend which shall look for all OLD folders (in main and in sub directory both) and delete the files from that folder. I can use tFilelist to and mask the files to be deleted. But unable to figure out how to configure the job to look for OLD folder in all sub directories and delete those files also.
What you need to do is in the tFileList put your main folder choose check box include sub directories and in the FileList type drop down list choose Directories. Your file mask should be "OLD" or if it is anything more "OLD".
Iterate and use the parameter ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
to capture your sub directories. Now you can use this folder path in a tFileDelete Which can also delete folders
follow below approach..
Add tFileList and configure to Travers over all the directories.
now use if conndition connection from tFileList
Add tJava and connect with iterator connection
Add tFileDelete after tJava and connect with IF condition.
Add below condition inside if condition.
((String)globalMap.get("tFileList_2_CURRENT_FILEPATH")).contains("OLD")
Now you will get the all files from all the directories above code will give pass to the files which has the "OLD" in there file path.
I have not tested but you can try it.
I want to copy some of the files to the specific folder after the successful compilation of the project. I have written a post build event as mentioned below:
xcopy "$(ProjectDir)bin" "$(TargetDir)..\..\Support Files\DBUpgradeUtility\" /Y
Note: the output path of my project has been set to bin folder for debug and release both the mode.
The above mentioned build event worked fine and all the files present under bin folder has been copied to destination folder. But along with the required files, the ‘vshost.exe’ files also copied, I don’t’ want this file. So, I have used the exclude parameter of xcopy build event as mentioned below:
xcopy "$(ProjectDir)bin" "$(TargetDir)..\..\Support Files\DBUpgradeUtility\" /Y /exclude:$(TargetDir)..\..\Support Files\DBUpgradeUtility\*.vshost.exe
With the above build event, the compilation failed and the error was:
The command "xcopy "C:\TFSWorkspace\FASTER.Web -
v6.3.Sprint.06\Source\Installer\Application\DBUpgradeUtility\bin"
"C:\TFSWorkspace\FASTER.Web -
v6.3.Sprint.06\Source\Installer\Application\DBUpgradeUtility\bin....\Support
Files\DBUpgradeUtility\" /Y /exclude:"C:\TFSWorkspace\FASTER.Web -
v6.3.Sprint.06\Source\Installer\Application\DBUpgradeUtility\bin....\Support
Files\DBUpgradeUtility*. vshost.exe" exited with code 4.
I have also googled for exclude parameter and then written the build event mentioned above. I cannot find what I am missing here or what I did wrong.
Please help me on this.
Thank you.
The /exclude option of the xcopy command works differently - it allows you to specify files which contain exclude filters:
Specifies a list of files. At least one file must be specified. Each
file will contain search strings with each string on a separate line
in the file.
When any of the strings match any part of the absolute
path of the file to be copied, that file will be excuded from being
copied. For example, specifying the string, \obj\ or .obj will exclude
all files underneath the directory obj or all files with the .obj
extension.
Therefore you may create a new file in your project (for example $(ProjectDir)excludes.txt) and add this line:
vshost.exe
Then change the option in your xcopy command to:
/exclude:"$(ProjectDir)excludes.txt"
This excludes all files containing vshost.exe in their absolute path. If you have to exclude other files, just add a new line to the file.
I want to exclude some directories from an archive using the PASE tar command on an IBMi but the [-X Exclude File] option doesn't seems to work for me.
I tried using an exclude file that just contained a file name (/home/JSMITH/data/sub2/file2.txt) and then one that just contained a pattern (*.txt), and neither archive operation omitted anything.
Given the following directory structure:
/home/JSMITH/data
/home/JSMITH/data/sub1
/home/JSMITH/data/sub1/file1.txt
/home/JSMITH/data/sub2
/home/JSMITH/data/sub2/file2.txt
/home/JSMITH/data/sub3
/home/JSMITH/data/sub3/file3.txt
and the following command:
/qopensys/usr/bin/tar -cvf /home/JSMITH/test.tar -X /home/JSMITH/excludes.txt /home/JSMITH/data
The entire /home/JSMITH/data structure gets included in the resulting archive.
I have tried using the /home/JSMITH/excludes.txt file with either of these contents:
/home/JSMITH/data/sub2/file2.txt
or
*.txt
How does one exclude files/directories/patterns from the IBMi PASE tar command?
You need the full path in the exclude file.
I created mine via ls /home/JSMITH/data/*.txt > /home/JSMITH/excludes.txt
If you're doing it by hand, make certain you haven't got any trailing whitespace.
Also, I used Notepad++ when I created mine by hand. I found that the green screen edtf created an EBCDIC file with CRLF in it, and that didn't exclude for me.
IBM i 7.1