Eskil

Diff
Login

Differences From Artifact [6967717442]:

To Artifact [ce76436a94]:


747
748
749
750
751
752
753
























754
755
756
757
758
759
760
        createdirectory - deletefile - removedirectory - utime {
            # Read-only, always error
        }
    }
    vfs::filesystem posixerror $::vfs::posix(EACCES)
    return -code error $::vfs::posix(EACCES)
}

























##################################################################
# Test structure
##################################################################
if 0 {
# File traversing stuff from wiki...
proc ftw_1 {{dirs .}} {







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
        createdirectory - deletefile - removedirectory - utime {
            # Read-only, always error
        }
    }
    vfs::filesystem posixerror $::vfs::posix(EACCES)
    return -code error $::vfs::posix(EACCES)
}

# Transfer a VcsVfs mount point to another Thread.
# TclVfs mounts are thread local.
# If no mount point is given, tranfer all current mount points
proc vcsvfs::transfer {threadId {mountpoint {}}} {
    variable mpoints
    thread::send -async $threadId "package require vcsvfs"
    if {$mountpoint eq ""} {
        set data $mpoints
    } else {
        set data [dict create $mountpoint [dict get $mpoints $mountpoint]]
    }
    # Data might be large. Is that a problem? Is there a more efficient way?
    thread::send -async $threadId [list vcsvfs::Receive $data]
}

# Create mount(s) from received data
proc vcsvfs::Receive {data} {
    variable mpoints
    foreach mountpoint [dict keys $data] {
        dict set mpoints $mountpoint [dict get $data $mountpoint]
        vfs::filesystem mount $mountpoint [list vcsvfs::Vfs]
    }
}

##################################################################
# Test structure
##################################################################
if 0 {
# File traversing stuff from wiki...
proc ftw_1 {{dirs .}} {