public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* |FILE_ID_BOTH_DIR_INFORMATION| fields |ShortName|+|ShortNameLength| mandatory for Cygwin and Window 10 ?
@ 2024-04-27 13:08 Roland Mainz
  2024-04-27 15:03 ` Brian Inglis
  0 siblings, 1 reply; 3+ messages in thread
From: Roland Mainz @ 2024-04-27 13:08 UTC (permalink / raw)
  To: cygwin

Hi!

----

Are the |FILE_ID_BOTH_DIR_INFORMATION| fields
|ShortName|+|ShortNameLength| mandatory these days, e.g. is it legal
to set |ShortNameLength = 0;| for Cygwin 3.4/3.5 in Windows 10 ?

Is there anything else for a filesystem driver to do to indicate that
|ShortName| support is not available ?

----

Bye,
Roland
-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

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

* Re: |FILE_ID_BOTH_DIR_INFORMATION| fields |ShortName|+|ShortNameLength| mandatory for Cygwin and Window 10 ?
  2024-04-27 13:08 |FILE_ID_BOTH_DIR_INFORMATION| fields |ShortName|+|ShortNameLength| mandatory for Cygwin and Window 10 ? Roland Mainz
@ 2024-04-27 15:03 ` Brian Inglis
  2024-05-02 11:34   ` Roland Mainz
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Inglis @ 2024-04-27 15:03 UTC (permalink / raw)
  To: cygwin

On 2024-04-27 07:08, Roland Mainz via Cygwin wrote:
> Are the |FILE_ID_BOTH_DIR_INFORMATION| fields
> |ShortName|+|ShortNameLength| mandatory these days, e.g. is it legal
> to set |ShortNameLength = 0;| for Cygwin 3.4/3.5 in Windows 10 ?

MS Windows 8/Server 2012+ disabled 8.3 short name generation on new 
volumes/partitions, for example see:

	https://ss64.com/nt/syntax-filenames.html

	https://archive.techarp.com/showarticle53b4.html?artno=827

https://learn.microsoft.com/en-ca/archive/blogs/josebda/windows-server-2012-file-server-tip-disable-8-3-naming-and-strip-those-short-names-too

https://learn.microsoft.com/en-ca/windows-server/administration/windows-commands/fsutil-8dot3name

This really makes a big difference on directories like /var/log/ and /tmp/ if 
apps create a lot of files with similar name prefixes there, for example, 
date/time suffixed long file names from multiple hourly cron jobs, as long names 
can be queried via the B-tree but short names have to be scanned sequentially.

> Is there anything else for a filesystem driver to do to indicate that
> |ShortName| support is not available ?

Also see fsutil behavior query|set disable8dot3 [[<volumepath> [{1|0}]]|<value>]

% fsutil 8dot3name set /?
usage : fsutil 8dot3name set [0 through 3] | [<Volume Path> 1 | 0]

When a volume is not specified the operation updates the registry value:

     0 - Enable 8dot3 name creation on all volumes on the system
     1 - Disable 8dot3 name creation on all volumes on the system
     2 - Set 8dot3 name creation on a per volume basis
     3 - Disable 8dot3 name creation on all volumes except the
               system volume

     When a volume is specified the operation updates the individual
         volume's on disk flag.  This operation is only meaningful
         if the registry value is set to 2.

     0 - Enable 8dot3 name creation on this volume
     1 - Disable 8dot3 name creation on this volume

This operation takes effect immediately (no reboot required).

Sample commands:
   "fsutil 8dot3name set 1"      - disable 8dot3 name creation on all volumes
   "fsutil 8dot3name set C: 1"   - disable 8dot3 name creation on c:

% regtool get -v 
/proc/registry/HKEY_LOCAL_MACHINE/System/CurrentControlSet/Control/FileSystem/NtfsDisable8dot3NameCreation
2

% fsutil 8dot3name query c:
The volume state is: 0 (8dot3 name creation is enabled).
The registry state is: 2 (Per volume setting - the default).

Based on the above settings, 8dot3 name creation is enabled on c:

% fsutil 8dot3name query d:
The volume state is: 0 (8dot3 name creation is enabled).
The registry state is: 2 (Per volume setting - the default).

Based on the above settings, 8dot3 name creation is enabled on d:

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

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

* Re: |FILE_ID_BOTH_DIR_INFORMATION| fields |ShortName|+|ShortNameLength| mandatory for Cygwin and Window 10 ?
  2024-04-27 15:03 ` Brian Inglis
@ 2024-05-02 11:34   ` Roland Mainz
  0 siblings, 0 replies; 3+ messages in thread
From: Roland Mainz @ 2024-05-02 11:34 UTC (permalink / raw)
  To: cygwin, ms-nfs41-client-devel

On Sat, Apr 27, 2024 at 5:03 PM Brian Inglis via Cygwin
<cygwin@cygwin.com> wrote:
>
> On 2024-04-27 07:08, Roland Mainz via Cygwin wrote:
> > Are the |FILE_ID_BOTH_DIR_INFORMATION| fields
> > |ShortName|+|ShortNameLength| mandatory these days, e.g. is it legal
> > to set |ShortNameLength = 0;| for Cygwin 3.4/3.5 in Windows 10 ?
>
> MS Windows 8/Server 2012+ disabled 8.3 short name generation on new
> volumes/partitions, for example see:
>
>         https://ss64.com/nt/syntax-filenames.html
>
>         https://archive.techarp.com/showarticle53b4.html?artno=827
>
> https://learn.microsoft.com/en-ca/archive/blogs/josebda/windows-server-2012-file-server-tip-disable-8-3-naming-and-strip-those-short-names-too
>
> https://learn.microsoft.com/en-ca/windows-server/administration/windows-commands/fsutil-8dot3name

Thanks...:-)
... for now I've disabled 8.3 short name generation in the
ms-nfs41-client driver (see
https://github.com/kofemann/ms-nfs41-client/commit/f5f276db6337f34d7705e9c981213e31adbb0c7d),
until I have time to implement working 8.3. short name algorithm...

[snip]
> > Is there anything else for a filesystem driver to do to indicate that
> > |ShortName| support is not available ?
>
> Also see fsutil behavior query|set disable8dot3 [[<volumepath> [{1|0}]]|<value>]
[snip]
> Sample commands:
>    "fsutil 8dot3name set 1"      - disable 8dot3 name creation on all volumes
>    "fsutil 8dot3name set C: 1"   - disable 8dot3 name creation on c:

Is there any filesystem driver/kernel API for this ?

[snip]
> Based on the above settings, 8dot3 name creation is enabled on c:
>
> % fsutil 8dot3name query d:
> The volume state is: 0 (8dot3 name creation is enabled).
> The registry state is: 2 (Per volume setting - the default).

Same question: Is there a driver/kernel API ?

----

Bye,
Roland
-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

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

end of thread, other threads:[~2024-05-02 11:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-27 13:08 |FILE_ID_BOTH_DIR_INFORMATION| fields |ShortName|+|ShortNameLength| mandatory for Cygwin and Window 10 ? Roland Mainz
2024-04-27 15:03 ` Brian Inglis
2024-05-02 11:34   ` Roland Mainz

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