File tree 1 file changed +3
-9
lines changed
1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -348,15 +348,12 @@ public class FSEntry
348
348
}
349
349
350
350
// / Create the root of the filesystem, only usable from this module
351
- package (dub) this (char drive = 0 )
351
+ package (dub) this (string name = null )
352
352
{
353
353
import std.datetime.date ;
354
354
SysTime DefaultTime = SysTime(DateTime (2020 , 01 , 01 ));
355
355
356
- if (drive) {
357
- assert (drive >= ' A' && drive <= ' Z' );
358
- this .name = drive ~ ` :\` ;
359
- }
356
+ this .name = name;
360
357
this .attributes.type = Type.Directory;
361
358
this .attributes.access = DefaultTime;
362
359
this .attributes.modification = DefaultTime;
@@ -451,11 +448,8 @@ public class FSEntry
451
448
// / Returns: The `path` of this FSEntry
452
449
public NativePath path () const scope
453
450
{
454
- version (Windows ) enum RootPath = " T:\\ " ;
455
- else enum RootPath = " /" ;
456
-
457
451
if (this .parent is null )
458
- return NativePath (RootPath );
452
+ return this .name.length ? NativePath(this .name) : NativePath( " / " );
459
453
assert (! NativePath(this .name).absolute, this .name);
460
454
auto thisPath = this .parent.path ~ this .name;
461
455
thisPath.endsWithSlash = (this .attributes.type == Type.Directory);
You can’t perform that action at this time.
0 commit comments