public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* BSD file flags support in Cygwin?
@ 2017-11-13 23:21 Bill Zissimopoulos
  2017-11-14 10:07 ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Bill Zissimopoulos @ 2017-11-13 23:21 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 743 bytes --]

Does Cygwin have any support for BSD file flags (UF_* flags, such as
UF_HIDDEN, etc.)? These flags are often used to provide support for
Windows file attributes (FILE_ATTRIBUTE_*, such as FILE_ATTRIBUTE_HIDDEN).

OSX and FreeBSD provide such support during stat(2) and chflags(2). I
expect that Cygwin does not have such support, but wanted to double-check.

https://www.freebsd.org/cgi/man.cgi?query=chflags&apropos=0&sektion=2&manpa
th=FreeBSD+11.1-RELEASE+and+Ports&arch=default&format=html


Bill

\x03B‹KCB”\x1c›Ø›\x19[H\x1c™\^[ܝ\x1cΈ\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÜ\x1c›Ø›\x19[\Ëš\x1d^[[\x03B‘TNˆ\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÙ˜\KÃB‘^[ØÝ[Y[\x18]\x1a[ÛŽˆ\b\b\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÙ^[ØÜËš\x1d^[[\x03B•[œÝXœØÜšX™H\x1a[™›Îˆ\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÛ[\vÈÝ[œÝXœØÜšX™K\Ú[\^[\x19CBƒB

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BSD file flags support in Cygwin?
  2017-11-13 23:21 BSD file flags support in Cygwin? Bill Zissimopoulos
@ 2017-11-14 10:07 ` Corinna Vinschen
  2017-11-14 19:17   ` Bill Zissimopoulos
  0 siblings, 1 reply; 4+ messages in thread
From: Corinna Vinschen @ 2017-11-14 10:07 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 938 bytes --]

On Nov 13 23:21, Bill Zissimopoulos wrote:
> Does Cygwin have any support for BSD file flags (UF_* flags, such as
> UF_HIDDEN, etc.)? These flags are often used to provide support for
> Windows file attributes (FILE_ATTRIBUTE_*, such as FILE_ATTRIBUTE_HIDDEN).
> 
> OSX and FreeBSD provide such support during stat(2) and chflags(2). I
> expect that Cygwin does not have such support, but wanted to double-check.
> 
> https://www.freebsd.org/cgi/man.cgi?query=chflags&apropos=0&sektion=2&manpa
> th=FreeBSD+11.1-RELEASE+and+Ports&arch=default&format=html

No, we don't support this.  We couldn't support it via stat anyway,
only via the extra chflags function group.  Patches welcome, as
long as it's the entire group of functions so chflags(1) compiles
OOTB.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BSD file flags support in Cygwin?
  2017-11-14 10:07 ` Corinna Vinschen
@ 2017-11-14 19:17   ` Bill Zissimopoulos
  2017-11-15  7:59     ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Bill Zissimopoulos @ 2017-11-14 19:17 UTC (permalink / raw)
  To: cygwin

Corinna, thanks for your answer.

My question was largely to confirm my understanding as I probably do not
have time to produce such a patch currently. For the benefit of the
discussion and to assist any future attempts at doing this:

Chflags(2) and friends would be relatively easy to implement. OTOH the
BSD’s and OSX use stat(2) to report file flags in st_flags. Since Cygwin
lacks an st_flags field, we would have to somehow change struct stat to
accommodate it. Do you have guidance on how to handle such a change? Would
you even want such a change? [I suspect not.]

[I know some OS’es have had to deal with stat(2) changes over the years,
but I am not as familiar with Cygwin history.]

Bill



On 11/14/17, 2:06 AM, Corinna Vinschen wrote:

>On Nov 13 23:21, Bill Zissimopoulos wrote:
>> Does Cygwin have any support for BSD file flags (UF_* flags, such as
>> UF_HIDDEN, etc.)? These flags are often used to provide support for
>> Windows file attributes (FILE_ATTRIBUTE_*, such as
>>FILE_ATTRIBUTE_HIDDEN).
>> 
>> OSX and FreeBSD provide such support during stat(2) and chflags(2). I
>> expect that Cygwin does not have such support, but wanted to
>>double-check.
>> 
>> 
>>https://www.freebsd.org/cgi/man.cgi?query=chflags&apropos=0&sektion=2&man
>>pa
>> th=FreeBSD+11.1-RELEASE+and+Ports&arch=default&format=html
>
>No, we don't support this.  We couldn't support it via stat anyway,
>only via the extra chflags function group.  Patches welcome, as
>long as it's the entire group of functions so chflags(1) compiles
>OOTB.
>
>
>Corinna
>
>-- 
>Corinna Vinschen                  Please, send mails regarding Cygwin to
>Cygwin Maintainer                 cygwin AT cygwin DOT com
>Red Hat


--
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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BSD file flags support in Cygwin?
  2017-11-14 19:17   ` Bill Zissimopoulos
@ 2017-11-15  7:59     ` Corinna Vinschen
  0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2017-11-15  7:59 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1527 bytes --]

On Nov 14 19:17, Bill Zissimopoulos wrote:
> Corinna, thanks for your answer.
> 
> My question was largely to confirm my understanding as I probably do not
> have time to produce such a patch currently. For the benefit of the
> discussion and to assist any future attempts at doing this:
> 
> Chflags(2) and friends would be relatively easy to implement. OTOH the
> BSD’s and OSX use stat(2) to report file flags in st_flags. Since Cygwin
> lacks an st_flags field, we would have to somehow change struct stat to
> accommodate it. Do you have guidance on how to handle such a change? Would
> you even want such a change? [I suspect not.]

You're right.  Struct stat is exposed to user space so changing this is
bound to break existing applications.  We *might* get away lightly with
just adding a member to the end as in this case, but is the support for
DOS flags actually worth it?  It's still a hassle to support new and old
apps in Cygwin in such cases.

> [I know some OS’es have had to deal with stat(2) changes over the years,
> but I am not as familiar with Cygwin history.]

An executable has the version info of the Cygwin version at the
time of building compiled in.  This is used in Cygwin to check
what an executable expects.

See winsup/cygwin/include/cygwin/version.h and the usage of the
checks throughout the code.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-15  7:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-13 23:21 BSD file flags support in Cygwin? Bill Zissimopoulos
2017-11-14 10:07 ` Corinna Vinschen
2017-11-14 19:17   ` Bill Zissimopoulos
2017-11-15  7:59     ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).