Skip to content

Input with / and output with both \ and / ?? #2009

@GnRSlash

Description

@GnRSlash

I am trying to use it Glob 2.1.3, with my API using Dart (3.5.4 (stable)) running on Windows 11 x64 Pro like this:

      Glob glob = Glob('//server/path1/path2/path with spaces3/Template.*');
      List<FileSystemEntity> files = glob.listSync();
      for (FileSystemEntity entity in files) {
        if (entity is File) {
          arquivos.add(entity.path.split(Platform.pathSeparator).last);
        }
      }

But the result inside entity.path has a file using both separators (\ and /), like this:

//server/path1\path2\path with spaces3\Template.xlsm

This is not a spectate behavior, because this way, we don't know how to work after the glob search...
If this behavior is normal, then how should I handle the result to separate the folders and files since I don't know which separator I should use?

Thank you in advance

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions