`Path.Combine`, `HasExtension`, `GetFileName` docs still describe .NET Framework volume-separator (`:`) handling
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 86/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- csharp
- Ambito
- documentation
Direzione di ricerca
Apri xml/System.IO/Path.xml e trova la documentazione per gli overload di Combine, HasExtension e GetFileName indicati nell’issue. Confronta le relative note e i testi dei valori restituiti con il comportamento moderno e con gli esempi .NET Framework forniti. L’attività è completata quando tutte le formulazioni interessate descrivono la gestione attuale dei separatori e identificano il comportamento del separatore di volume come specifico di .NET Framework.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Type of issue
Outdated article
Description
Several docs related to System.IO.Path APIs describe special handling of the volume separator (:) that modern .NET removed in .NET Core 2.1.
Path.Combine: the remarks for Combine(string, string), Combine(string, string, string), Combine(string, string, string, string) and Combine(params string[]) say a separator is appended only if the preceding path "is not a drive reference (that is, "C:" or "D:")" and does not end in DirectorySeparatorChar, AltDirectorySeparatorChar, or VolumeSeparatorChar. On .NET Core 2.1+ only DirectorySeparatorChar/AltDirectorySeparatorChar are checked, and no drive references:
| Call | .NET 10 | .NET Framework 4.x |
|---|---|---|
Path.Combine("C:", "foo") |
C:\foo |
C:foo |
Path.Combine("C:", "foo", "bar") |
C:\foo\bar |
C:foo\bar |
Path.Combine(new[] { "C:", "foo" }) |
C:\foo |
C:foo |
The fixed-arity overloads changed in dotnet/coreclr#15579, and the params string[] overload in dotnet/coreclr#16447. Discussion in dotnet/runtime#27535 confirms that the change was intentional.
The same PR, dotnet/coreclr#16447, has adjusted behavior of several other APIs in a similar manner (removed special treatment of :), invalidating some other remarks:
HasExtension(both overloads): return value and remarks say the search stops atVolumeSeparatorChar. It no longer does:Path.HasExtension(@"C:\a.b:c")istrueon .NET 10 andfalseon .NET Framework.GetFileName(both overloads): says the result is empty when the path ends in a volume separator. Only a drive root counts now:Path.GetFileName(@"C:\file.txt:stream")returnsfile.txt:streamon .NET 10 andstreamon .NET Framework;Path.GetFileName("foo:")returnsfoo:on .NET 10 and an empty string on .NET Framework. (The string overload's remarks already list onlyDirectorySeparatorChar/AltDirectorySeparatorChar, which contradicts its own return-value text.)
Proposal: describe the modern behavior (only DirectorySeparatorChar/AltDirectorySeparatorChar are treated as separators; a drive reference such as C: is still recognized at the start of a path, but not treated specifically by the affected APIs, e.g. Path.Combine). Add notes on the volume-separator behavior being specific .NET Framework only.
Page URL
Content source URL
https://github.com/dotnet/dotnet-api-docs-temp/blob/live/xml/System.IO/Path.xml
Document Version Independent Id
fe224bbb-0eec-28fe-93e4-80a25b795e62
Platform Id
3916d1a3-5b50-d6c3-65d1-d12ac54cc834
Article author
@dotnet-bot
- Lingua principale
- C#
- Stelle
- 954
- Fork
- 1.7k
- Merge medio
- 1g 7h
- PR unite (30g)
- 53
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di dotnet/dotnet-api-docs
-
dotnet-target-version untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
dotnet/dotnet-api-docs#13129 ·
I maintainer di solito rispondono entro 1 giorno
-
dotnet-target-version untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
dotnet/dotnet-api-docs#13128 ·
I maintainer di solito rispondono entro 1 giorno
-
untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
dotnet/dotnet-api-docs#13122 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
AsyncLocal<T> Class ArticleApertaarea-System.Threading untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
dotnet/dotnet-api-docs#13091 ·
I maintainer di solito rispondono entro 1 giorno
-
untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
dotnet/dotnet-api-docs#13039 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di dotnet/dotnet-api-docs
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
dotnet/command-line-api#2852 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
modelcontextprotocol/csharp-sdk#1899 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
ClickHouse/clickhouse-cs#639 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
ifpebj-ti/controle-acesso-veiculos#377 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno