Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network paths don't work after 3.4.0 #56049

Closed
BananaMasterz opened this issue Jun 19, 2024 · 4 comments
Closed

Network paths don't work after 3.4.0 #56049

BananaMasterz opened this issue Jun 19, 2024 · 4 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-io triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@BananaMasterz
Copy link

Running the following code in dart 3.4.0 on WINDOWS raises PathNotFoundException

import 'dart:io';

void main() async {
  print(await File(r'\\my_srv\some_path\test.txt').exists());
  File(r'\\my_srv\some_path\test.txt').copy(r'C:\path\test.txt');
}

but works fine in earlier versions (like 3.3.4 and 3.0.0).

I see there have been some changes like this one (maybe some more) that could be the cause.

I also see that there are not tests set up for network paths so this isn't caught.

Finally I'm not sure why File().exists()) returns true but .copy() can't see the file... shouldn't both methods resolve the paths in the same manner?

This is my OS:

Edition	Windows 11 Pro
Version	23H2
Installed on	‎27/‎3/‎2024
OS build	22631.3737
@dart-github-bot
Copy link
Collaborator

Labels: area-vm, type-bug
Summary: The user reports that network paths in Dart code, which worked in earlier versions, now throw PathNotFoundException in Dart 3.4.0 on Windows. The issue appears related to recent changes in the Dart SDK, and the user notes a lack of tests for network paths.

@dart-github-bot dart-github-bot added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jun 19, 2024
@devoncarew
Copy link
Member

cc @mraleph @brianquinlan

@mraleph mraleph self-assigned this Jun 19, 2024
@mraleph
Copy link
Member

mraleph commented Jun 19, 2024

Yeah it was c2e9cee that broke this.

Well, our handling of long UNC paths apparently was always broken and the change in question simply forced copy to use it - which revealed its bugyness.

I am going to fix this. I also realized that File::Copy forces wrong path into "long" format. It is supposed to force destination into long form - but instead forces source, which makes no sense.

Need to fix that as well and write a test.

@mraleph
Copy link
Member

mraleph commented Jun 19, 2024

I think this should fix it: https://dart-review.googlesource.com/c/sdk/+/372400 - will finish it up tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-io triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants