using robocopy to copy only files with a specific attribute - attributes

I am very new to using the command line and I am trying to write a batch file that, at one point, will robocopy only the files with a Read Only attribute from one directory to another. I see that there are ways to add and delete attributes when copying and I can see that RASHCNETO file option is the closest fit as it states that it does what I'm trying to get it to do. But I don't know where to write the exact code for it. I have searched online and have not found this specific answer yet. I have tried variations, looked it up here in the archive, online and watched some tutorials (which have been very helpful for general learning but not about this specific instance). The latest variation I tried was:
robocopy C:\Users\K002\final_a C:\Users\K002\final_b /COPY:DAT /A:R /RASHCNETO
robocopy C:\Users\K002\final_a C:\Users\K002\final_b /COPY:DAT /IA /RASHCNETO::R
robocopy C:\Users\K002\final_a C:\Users\K002\final_b /COPY:DAT /IA /RASHCNETO::/R
For all variations I have tried, it comes back with a parameter error message relating to the part with RASHCNETO (either the /IA or the /A:R bit.

Related

How can I make usbmon log file (*.mon)?

I'm trying to vusb-analyzer.
It requires *.mon log file.
How can I make usbmon log file (*.mon)?
https://www.kernel.org/doc/Documentation/usb/usbmon.txt
The document you linked in your question is actually the answer, please see the sections 1-3.
In section 3, it says:
# cat /sys/kernel/debug/usb/usbmon/0u > /tmp/1.mon.out
This will create a text file 1.mon.out. Its structure is also described in the same document.
Now, how do I know that this is the file to be opened by vusb-analyzer? From what I see, the website of this project doesn't make it clear what the *.mon file is.
However, you can see it in the source code:
https://github.com/scanlime/vusb-analyzer/blob/master/VUsbTools/Log.py#L498
It clearly states, that the program uses the syntax described in the document that you already know:
https://www.kernel.org/doc/Documentation/usb/usbmon.txt
The name of your file doesn't really matter, but if you want it to end with ".mon", you could simply use:
# cat /sys/kernel/debug/usb/usbmon/0u > ~/somefile.mon
Two warnings:
The line with cat I posted here is just an example and in order to use it, you will need to follow the steps in the document (it won't work without enabling usbmon first)
vusb-analyzer hasn't been updated for years and I wasn't able to run it on my machine. Its website mentions Ubuntu 8.10 so I wouldn't be surprised if others had problems running it, too. (For example, in order to reproduce your problem, provide more help).

cv2.VideoCapture directory of images

I though this would be simple, but i have been caught by the simplest of puzzles which i can't find the answer to anywhere,
I have some code which reads images and then OpenCV looks for differences.
I read files with the following command
vs = cv2.VideoCapture("/home/andrew/images/image_%6d.jpg")
and this work perfectly with images called image_000000.jpg image_000001.jpg
However i don't want to rename my images so i would like to read files called
MDAlarm_20180921-031140.jpg whcih contain the date then time.
What is the printf format for this ? as what ever I try it does not work i.e no files found or do the files need to start from 0 , so i need to append an index
starting at 000000?
Lastly once i have this working how can i tell which file is being processed ?
Many Thanks
Andrew

Cannot zip files with the same name?

I could not believe this: it seems that the zip specification does not allow two different files with the same file name going into one zip file.
In my case I use an external file to specify all the files I wanna zip.
This could look like this:
../Website1/favicon.ico
../Website2/favicon.ico
and there we are, that's not possible, despite keeping the directory structure. You would expect the name to be <../Website1/favicon.ico> rather than but that does not seem to be the case, I get:
"Invalid ZIP request (cannot repeat names in Zip file)"
with WinZip. I tried the same with 7Zip - same result.
Strangely googling did not show many hits that really fit but those I found seem to confirm my findings. That's hard to believe since this limitation is very severe. I actually struggle to understand why this did not hit me a couple of decades earlier.
Am I overlooking something very basic here?
To be precise:
Adding these two files:
C:\Temp\Website1\FavIcon
C:\Temp\Website2\FavIcon
results in a single file; the last Add wins...
This however:
Website1\FavIcon
Website2\FavIcon
results in a zip file that contains both files.

Modifying project with multiple solutions files and multiple project files referencing each other

I have a project structure like -
proj_Main
proj_A(directory)
somefile.cs(etc.)
proj_A.csproj
proj_B(dir)
somefile.cs
proj_B.csproj
proj_C(dir)
somefile.cs
proj_C.csproj
proj_D(dir)
somefile.cs
proj_D.csproj
proj_Main(dir)
other dirs etc.
some.cs files
proj_Main.csproj
proj_Main.csproj.user
proj_Main2010.csproj
proj_Main2010.csproj.user
proj_Main2010.v11.suo
proj_A.sln
proj_B.sln
proj_C.sln
proj_D.sln
proj_Main.sln
proj_Main2010.sln
(There are actually more than 10 solutions inside it, to keep it simple, I have depicted 4 above.)
While opening it in VS 2012 I have opened proj_Main2010.sln and it shows other linked projects with it, opens them inside the solution. This proj_Main refers the dll of other projects from those other projects. So far fine.
Now I have to modify the code from all project files, but if I do that, the previously referenced classes and code stops working, and throws errors of all sort -
Error 2 The type or namespace name 'XXXX' could not be found (are you missing a using directive or an assembly reference?)
I am not sure, If this is the correct way to depict the scenario, my apologies for that.
My problem is, I am not sure If I am opening the right file to work on this solution or if I am trying to modify the files safely.
Any suggestions would be appreciated.
p.s. I also have a setup project in it ( but I guess its related to deploying an application not useful while developing /redeveloping it)

Getting echofunc.vim to work

I came across echofunc.vim today (from a link in SO). Since I'm rubbish at remembering the order of function parameters, it looked like a very useful tool for me.
But the documentation is a bit lean on installation! And I've not been able to find any supplementary resources on the internet.
I'm trying to get it running on a RHEL box. I've copied the script into ~/.vim/plugin/echofunc.vim however no prompt when I type in a function name followed by '('. I've tried adding
let g:EchoFuncLangsUsed = ["php","java","cpp"]
to my .vimrc - still no prompting.
I'm guessing it needs to read from a dictionary somewhere - although there is a file in /usr/share/vim/vim70/ftplugin/php.vim, this is the RH default and does not include an explicit function list.
I'm not too bothered about getting hints on the functions/methods I've defined - just trying to get hints for the built-in functions. I can see there is a dictionary file available here which appears to provide the resources required for echofunc.vim, I can't see how I set this up.
TIA,
It expects a tags file, the last line of the description describes exactly how to generate it:
ctags -R --fields=+lS .
It works here with PHP but not with JS. Your mileage may vary.
I didn't know about this plugin, thanks for the info.
You should try phpcomplete.vim, it shows a prototype of the current function in a scratchpad. It is PHP only, though.

Resources