Lately non techy people ask me what O/S I prefer: APPLE or WINDOWS?. Often with the more techy inclined the topic does come up at some point in our conversation: APPLE, WINDOWS, LINUX, BSD, Solaris, OS390 (zOS).
When I was in university at some point I said to a good friend of mine "When I grow older and I have a house I will have one computer with each platform" Well I am older now and I have a house, and wife, and kids, and spare computer parts (doesn't everyone have them), lego, tons of lego, although not enough. But the one thing that I also have is accomplished my dream of having one copy at least, of each platform, so not only I have accomplished my dream but over accomplished it, because in reality I have multiple copies of many platforms.
Back then in Uni i was really refering and having: 1 linux, 1 Windows, 1 Mac at that time people would ask me why a Mac? and not everyone would know also that there was something call Machintosh.... well those times certainly have change.. haven't they?
So which platform I prefer? I will say not OS/390 or AS/400 but maybe because I don't have enough experience with them, my experience with both of those platforms have been limited by access at times.
I declare myself O/S Agnostic.
Friday, March 24, 2017
Deleting files in subdirectories and creating empty folders for Windows users
If you have had to create a directory structures to provide a template for other users, you can find some tricks online on how to do that. But all of those post seem to be lacking of "how to create a file in each directory in windows".
The other day I found myself with this need as I had to check a directory structure in GIT, and GIT doesn't like you checking in empty folders.
So first I copy the directory strucuture that I wanted from somewhere else and then deleted all the files inside using:
Del /R *.*
Well that easy I had a bunch of empty folders now to create the empty file.
Reading up on batch scripting which I have done in the past after several tries I came up with this:
@echo off
setlocal
set "location=W:\GitRepo\src\patch\ConsolidatePatch7"
for /R %location% %%G in (.) do (
Pushd %%G
echo. 2>.readme
Popd
)
That created a .readme file on each and every directory and subdirectory of location. I was then able to check in this strucutre in GIT without a problem.
The other day I found myself with this need as I had to check a directory structure in GIT, and GIT doesn't like you checking in empty folders.
So first I copy the directory strucuture that I wanted from somewhere else and then deleted all the files inside using:
Del /R *.*
Well that easy I had a bunch of empty folders now to create the empty file.
Reading up on batch scripting which I have done in the past after several tries I came up with this:
@echo off
setlocal
set "location=W:\GitRepo\src\patch\ConsolidatePatch7"
for /R %location% %%G in (.) do (
Pushd %%G
echo. 2>.readme
Popd
)
That created a .readme file on each and every directory and subdirectory of location. I was then able to check in this strucutre in GIT without a problem.
Subscribe to:
Posts (Atom)