Changeset 2437
- Timestamp:
- 07/10/07 06:58:52 (1 year ago)
- Files:
-
- trunk/example/networking/vfs.d (modified) (2 diffs)
- trunk/tango/io/vfs/LocalFolder.d (modified) (1 diff)
- trunk/tango/io/vfs/VFS.d (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/example/networking/vfs.d
r2416 r2437 21 21 22 22 vfs.createFolder("/test"); 23 vfs.createFolder("/test/subdir"); 23 24 24 25 auto somedir = vfs.openFolder("/test/subdir"); … … 28 29 } 29 30 30 vfs.write("/test/subdir/mynew.file", vfs.read("/t est/anold.file"));31 vfs.write("/test/subdir/mynew.file", vfs.read("/tango/io/Stdout.d")); 31 32 32 33 } trunk/tango/io/vfs/LocalFolder.d
r2416 r2437 66 66 { 67 67 FilePath dir = new FilePath(_localPath.toUtf8); 68 dir = cast(FilePath)dir.append( path);68 dir = cast(FilePath)dir.append(FilePath.padded(path)); 69 69 dir.createFolder; 70 70 trunk/tango/io/vfs/VFS.d
r2416 r2437 288 288 if (vfspath.segmentCount == 1 && 289 289 _tempFolder !is null && 290 _tempFolder.exists(vfspath.segment(0))) {290 !_tempFolder.exists(vfspath.segment(0))) { 291 291 auto folder = _tempFolder.createFolder(vfspath.segment(0)); 292 292 mount(folder, vfspath.segment(0)); … … 576 576 final bool isAbsolute () 577 577 { 578 return (folder_ > 0) || 579 (folder_ < end_ && fp[folder_] is PathSeparatorChar); 578 return (fp[0] is PathSeparatorChar); 580 579 } 581 580 … … 933 932 return file; 934 933 935 uint start = isAbsolute ? 1 : 0;934 uint start = folder_; 936 935 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) { 939 938 count++; 940 939 if (count -1 == idx) 941 return fp[start..i ];940 return fp[start..i+1]; 942 941 else 943 start = i + 1;942 start = i + 2; 944 943 } 945 944 } … … 994 993 995 994 if (isDir) segments_--; 996 if (isAbsolute) segments_--; 995 if (isAbsolute) { 996 folder_ = 1; 997 segments_--; 998 } 997 999 998 1000 return this;












