Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 2437

Show
Ignore:
Timestamp:
07/10/07 06:58:52 (1 year ago)
Author:
larsivi
Message:

various fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/example/networking/vfs.d

    r2416 r2437  
    2121 
    2222    vfs.createFolder("/test"); 
     23    vfs.createFolder("/test/subdir"); 
    2324 
    2425    auto somedir = vfs.openFolder("/test/subdir"); 
     
    2829    } 
    2930 
    30     vfs.write("/test/subdir/mynew.file", vfs.read("/test/anold.file")); 
     31    vfs.write("/test/subdir/mynew.file", vfs.read("/tango/io/Stdout.d")); 
    3132 
    3233} 
  • trunk/tango/io/vfs/LocalFolder.d

    r2416 r2437  
    6666    { 
    6767        FilePath dir = new FilePath(_localPath.toUtf8); 
    68         dir = cast(FilePath)dir.append(path); 
     68        dir = cast(FilePath)dir.append(FilePath.padded(path)); 
    6969        dir.createFolder; 
    7070 
  • trunk/tango/io/vfs/VFS.d

    r2416 r2437  
    288288        if (vfspath.segmentCount == 1 && 
    289289            _tempFolder !is null && 
    290             _tempFolder.exists(vfspath.segment(0))) { 
     290            !_tempFolder.exists(vfspath.segment(0))) { 
    291291            auto folder = _tempFolder.createFolder(vfspath.segment(0)); 
    292292            mount(folder, vfspath.segment(0)); 
     
    576576        final bool isAbsolute () 
    577577        { 
    578                 return (folder_ > 0) || 
    579                        (folder_ < end_ && fp[folder_] is PathSeparatorChar); 
     578                return (fp[0] is PathSeparatorChar); 
    580579        } 
    581580 
     
    933932                return file; 
    934933 
    935             uint start = isAbsolute ? 1 : 0
     934            uint start = folder_
    936935            uint count; 
    937             foreach (i, c; fp[0..end_]) { 
    938                 if (i > 0 && c == PathSeparatorChar) { 
     936            foreach (i, c; fp[folder_..end_]) { 
     937                if (c == PathSeparatorChar) { 
    939938                    count++; 
    940939                    if (count -1 == idx) 
    941                         return fp[start..i]; 
     940                        return fp[start..i+1]; 
    942941                    else 
    943                         start = i + 1
     942                        start = i + 2
    944943                } 
    945944            } 
     
    994993 
    995994                if (isDir) segments_--; 
    996                 if (isAbsolute) segments_--; 
     995                if (isAbsolute) { 
     996                    folder_ = 1; 
     997                    segments_--; 
     998                } 
    997999 
    9981000                return this;