getting windows ntfs file info

2013-12-30 Thread Jon Retting
Hello,
    Typed up this one liner function for getting a files actual windows 
details/properties information.  I needed a tertiary way to compare 
executable/drivers, so a version number from windows seemed like a viable 
option. Hopefully someone will find this handy, seeing as i feel so guilty for 
not contributing more to such a wonderful project like Cygwin. And heck 
anything's better than that most recent dosshell thread :)

#get file details from windows via wmic wmi formatted call condensed
finfo() { [[ -f "$(cygpath "$@")" ]] || { echo "bad-file";return 1;}; echo 
"$(wmic datafile where name=\""$(echo "$(cygpath -wa "$@")"|sed 
's/\\//g')"\" get /value)"|sed 's/\r//g;s/^M$//;/^$/d'|awk -F"=" '{print 
$1"=""\033[1m"$2"\033[0m"}';}

ex:
$ finfo notepad.exe
$ finfo "C:\windows\system32\notepad.exe"
$ finfo /cygdrive/c/Windows/System32/notepad.exe
$ finfo "/cygdrive/c/Program Files/notepad.exe"
$ finfo ../notepad.exe

There is no doubt the brilliant people here could have done a better job, but 
like i said, i just needed to contribute something.  And if you are a gamer you 
might appreciate this https://github.com/jonretting/geforce-driver-check 

Cheers,
JR



--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: chmod Not Working

2013-12-30 Thread bartels

On 12/30/2013 06:16 AM, Nithin Kurien wrote:

When I type the following sequence of commands:

cd ~; mkdir sample; chmod -R 0700 sample; stat -c "%a %u %g" sample;
rm -rf sample; mkdir sample; chmod -R 0755 sample; stat -c "%a %u %g"
sample

the output is:

770 1001 513
775 1001 513

Why is chmod not working?

OS: Windows 8 Pro 64-bit
Cygwin Setup.exe Version: 2.831 (32-bit)


That looks fine to me.
What do you expect?

--
- Bartels


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: chmod Not Working

2013-12-30 Thread Nellis, Kenneth
From: bartels
> 
> On 12/30/2013 06:16 AM, Nithin Kurien wrote:
> > When I type the following sequence of commands:
> >
> > cd ~; mkdir sample; chmod -R 0700 sample; stat -c "%a %u %g" sample;
> > rm -rf sample; mkdir sample; chmod -R 0755 sample; stat -c "%a %u %g"
> > sample
> >
> > the output is:
> >
> > 770 1001 513
> > 775 1001 513
> >
> > Why is chmod not working?
> >
> > OS: Windows 8 Pro 64-bit
> > Cygwin Setup.exe Version: 2.831 (32-bit)
> 
> That looks fine to me.
> What do you expect?

Presumably because when the OP asked for 700 he got 770, and when
he asked for 755 he got 775.

--Ken Nellis

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: A ream of questions

2013-12-30 Thread Andrey Repin
Greetings, Eliot Moss!


> (Sent first version to Andre only ... sorry, Andre!)

This is why I set "reply-to" address back to list...
If you WANT to send me a private message, you can do it. But with default
setup, your replies transparently sent to the list.


--
WBR,
Andrey Repin (anrdae...@yandex.ru) 31.12.2013, <00:14>

Sorry for my terrible english...


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: A ream of questions

2013-12-30 Thread Andrey Repin
Greetings, Jonathan Martin!

> I suspected I would not get my point across, but the questions were more 
> important. 

If I understand your complaints right, you have to go to the very home page of
the project and carefully read the very first few paragraphs there, carefully
named "What [cygwin] is" and "what [cygwin] isn't".

>>> I've been fooling around with Cygwin for awhile now and I haven't done
>>> anything overly serious with it but I have spent a serious amount of time
>>> just thinking about what it could do and fooling around with other tools
>>> that look like it. I've come up with questions that don't have answers yet,
>>> though I've had to condense them down to just the questions.
> 
> 
>>> Q: Why doesn't cygwin use an emacs as its frontend instead of a dosshell?
> 
>> What is "dosshell"? Whatever it is, Cygwin doesn't use it. It use either
>> native Windows console or it's own mintty by default.

> The DOS shell is the native mintty for windows, even if you use a shell
> program the buffer is a DOSshell window.

You're not helping. Probably you don't know yourself, what you are trying to
convey... in either case, your circular references point nowhere.

> Emacs has a primitive Unixy shell that could be used as the terminal for
> Cygwin, and can broaden its functionality through powershell hacking in
> Emacs Lisp. It has also already fixed the common path conversion issue. This
> was one of my favorite questions so I have a few ideas on why this would be
> better. 

If you want a powercrap, use it.
I prefer bash.

>>> Q: Why don't we work on setting up a full blown tutorial system with a set
>>> of shell scripts and documentation segregation so that newbies can grok The
>>> Hacker's Dreaming?
> 
>> You're very welcome.

>    I have no idea what this means?

"You're very welcome to improve everything you see."
This is more clear?

> What I was getting at is that a simple document and a few scripts could be
> written that tells new users about the filesystem and a few basic tools
> while teaching them about compiling with something that isn't likely to
> break, documentation.

All the documentation about filesystem is avail... oh, wait... Microsoft
doesn't tell us shit about their filesystem...

If sarcasm isn't clear enough: Cygwin is NOT a new operating system. Largely,
it isn't even an application in itself, to tell the truth. At the core, Cygwin
project could be described as just a single library. cygwin1.dll. What you
imply in this your statement just not applicable to Cygwin.

> This could go on to make the whole process less confusing for new users.

Erm?... If you are not familiar with Linux tools, and not intend to be, Cygwin
will be of no use to you, I'm afraid.

>>> Q: Why doesn't Cygwin do something similar to Cpan?

>> And what exactly that supposed to mean?

> cpan is the module system for Perl. Its much easier to use than most of the
> packaging systems I've used that aren't also the cornerstone of a
> distribution. I had thought it might be possible to use something similar
> with cygwin so that mirrors would not be the issue they are now. 

What issues we are speaking about?.. I don't see any.

>>> Q: Why is "#!>help" so useless? Why doesn't it get fixed to act more like
>>> the old DOS help?

>> Explain, what you mean, especially, what you mean by "dos help"?

> In windows, and in legacy DOS consoles, "Help" was an interactive help that
> listed the major commands. In Linux its a printf with accessories.

In Linux, it's "man", dear. Also "info". So does it in Cygwin.

> My reference is DOS 5 and newer, and I think its better and part of why linux
> is less popular. 

Perhaps, you just don't know, how to cook it?
So far, I was finding any necessary information about Linux commands right
inside the box.
Not like there's no Google to help, though... I picked quite a lot of good
tricks from user comments across the internets.


--
WBR,
Andrey Repin (anrdae...@yandex.ru) 31.12.2013, <00:17>

Sorry for my terrible english...

Re: chmod Not Working

2013-12-30 Thread Max Polk

On 12/30/2013 2:23 PM, Nellis, Kenneth wrote:

From: bartels

On 12/30/2013 06:16 AM, Nithin Kurien wrote:

When I type the following sequence of commands:

cd ~; mkdir sample; chmod -R 0700 sample; stat -c "%a %u %g" sample;
rm -rf sample; mkdir sample; chmod -R 0755 sample; stat -c "%a %u %g"
sample

the output is:

770 1001 513
775 1001 513

Why is chmod not working?

OS: Windows 8 Pro 64-bit
Cygwin Setup.exe Version: 2.831 (32-bit)

That looks fine to me.
What do you expect?

Presumably because when the OP asked for 700 he got 770, and when
he asked for 755 he got 775.


The groups magically changing reminds me of the group setuid ("sticky") 
bit being set.  Try a "ls -ld ~" and see what's up with your home 
directory.  And maybe open up your home directory permissions from 
Windows Explorer and see if there are special object inherit options 
coming from parent directories that might be affecting it (if not using 
windows pro, "cd; cacls .")



--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



getting windows ntfs file info

2013-12-30 Thread Jon Retting
Hello,
    Typed up this one liner function for getting a files actual windows 
details/properties information.  I needed a tertiary way to compare 
executable/drivers, so a version number from windows seemed like a viable 
option. Hopefully someone will find this handy, seeing as i feel so guilty for 
not contributing more to such a wonderful project like Cygwin. 

#get file details from windows via wmic wmi formatted call condensed
finfo() { [[ -f "$(cygpath "$@")" ]] || { echo "bad-file";return 1;}; echo 
"$(wmic datafile where name=\""$(echo "$(cygpath -wa "$@")"|sed 
's/\\//g')"\" get /value)"|sed 's/\r//g;s/^M$//;/^$/d'|awk -F"=" '{print 
$1"=""\033[1m"$2"\033[0m"}';}

ex:
$ finfo notepad.exe
$ finfo "C:\windows\system32\notepad.exe"
$ finfo /cygdrive/c/Windows/System32/notepad.exe
$ finfo "/cygdrive/c/Program Files/notepad.exe"
$ finfo ../notepad.exe

There is no doubt the brilliant people here could have done a better job, but 
like i said, i just needed to contribute something.  And if you are a gamer you 
might appreciate this https://github.com/jonretting/geforce-driver-check 

Cheers,
JR



--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Clearing the buffer after quitting LESS, MAN, VIM etc.

2013-12-30 Thread Dawid Ferenczy
Hi,

maybe I have found a bug in the Cygwin.

I have been using Cygwin on the 64bit Windows 7 for a long time and I never
experienced this problem. But I bought a new laptop and on the fresh new
system (also 64bit Windows 7) the same Cygwin with the same configuration
cleared the screen buffer whenever I quit LESS, MAN, VIM etc. And it
bothered me very much.

Because I'm using Cygwin inside ConEmu terminal emulator, I suspected
the ConEmu. After a lot of hours comparing everything what potentially
could be the cause (environment variables, configurations, software
versions etc.), I had a conversation with the ConEmu's author (and he was
really great, exemplary support for the free software!). And we finally
found the cause.

The only difference (or one of few) was in the display size. The old laptop
has a screen resolution of 1366 x 768 pixels, while the new one has
1920 x 1080. And I'm using the whole screen for the terminal window. It's
really strange, but if the terminal window height is greater than
cca 62 lines, the screen buffer is cleared after quitting the LESS, VIM
etc. No matters if Cygwin is executed inside the ConEMu or plain cmd.exe.
Making the terminal window smaller solved the problem. Window height
of 62 lines seems to be fine for me. Also, with some of greater height
values, the LESS/VIM process sometimes crashed.

The whole story how we have found the cause and workaround of this
issue you could find here:
http://code.google.com/p/conemu-maximus5/issues/detail?id=1397

Could somebody reproduce this issue, please?


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Clearing the buffer after quitting LESS, MAN, VIM etc.

2013-12-30 Thread Dawid Ferenczy
Dawid Ferenczy  volny.cz> writes:

> Hi,
> 
> maybe I have found a bug in the Cygwin.



Hi again,

I forgot to mention some essential data :)

I'm using the 64bit version of Cygwin on the 64bit Windows 7 Home Premium, 
cygwin1.dll version is 1.7.27, setup.exe version is 2.831.

The issue appears under the ConEmu terminal emulator and also under the 
plain cmd.exe.

Dawid Ferenczy



--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple