View Single Post
Old 10-04-2009, 12:36 AM  
dr.owned
Junior Member
 
Join Date: Oct 2009
Posts: 24
Default

Yil, could you please check out this script i wrote?

PHP Code:
putlog -general "Script called"

set remount [string range [lindex $ioArgs 01 end-1]
if {[
string index $remount end] == "/"} {set remount [string range $remount 0 end-1]}
if {[
string index $remount 0] == "/"} {set remount [string range $remount 1 end]}
set remount "/_$remount"

set path [resolve pwd $remount]

if {[
file isfile $path] == 1} {
    
ioVirtual AddFile 0 1 1 "anonymous" "nobody" 0755 "||RESOLVED||" "$remount/[file tail $path]"
    
return 1
}

set dirs [glob -nocomplain -type d "$path/*"]
if { [
llength $dirs] > } {
    foreach 
d $dirs {
    
putlog -general $d
    ioVirtual AddSubDir 
[file tail $d]
    }
}

set files [glob -nocomplain -type f "$path/*"]
if { [
llength $files] > } {
    foreach 
f $files {
    
ioVirtual AddFile [file size $f1 1 "anonymous" "nobody" 0755 [file tail $f""
    
}
}

return 

here i'm just trying to popullate virtual directory with contents of another mounted directory ($remount). as you suggested, i use empty string "" as a link and file listing in web browser looks great ^) but when i try to retr a file ioftpd says "modifying virtual directories is not allowed" and does not call my script to ||resolve|| the file (there is no "Script called" line in the log).

and why stor to virtual dir is not allowed? following the same idea of ||resolve||-ing filenames, a script should just point out a vfs destination for server and the rest is just like a normal upload..
dr.owned is offline   Reply With Quote