Skip to content

Link.create only works for directories on windows #33966

Closed
@jakemac53

Description

example program:

import 'dart:io';

main() async {
  var  link = new Link('link.txt');
  await link.create('original.txt');
}

This will "succeed" on both linux and windows, but on windows it will create a directory symlink which doesn't work (since its actually pointing at a file). You end up getting a permissions error if you try and open the symlink.

As far as I can tell windows has supported symlinks for files as well as directories for a while now (at least since vista), so the above should be able to work, although I am not sure how complex it would be to implement.

It looks like the windows file implementation assumes a directory, although this is not documented or validated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions