Go Back   FlashFXP Forums > > > >

Suggestions Got a new idea or addition which would benefit IOFTPD? Post it here!

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 3.00 average. Display Modes
Old 06-02-2005, 02:44 PM   #1
mentality
Junior Member
 
Join Date: May 2005
Posts: 14
Default resolve pwd //

allow io to resolve (like unix) pwd with multiple /s in path from tcl, ie. ///pwd//here/etc///etx will equal /pwd/here/etc/etx
mentality is offline   Reply With Quote
Old 06-02-2005, 02:53 PM   #2
tuff
Senior Member
FlashFXP Registered User
ioFTPD Scripter
 
Join Date: Jan 2003
Posts: 277
Default

and this is usefull for what?

io already has resolve functions,

resolve pwd $pwd

which will resolve /this/is/a/test to c:\site\whatever\this\is\a\test

a simply regsub/exp would remove the unneeded /`s from your pwd
__________________
#iotools #ioftpd (both on efnet)
tuff is offline   Reply With Quote
Old 06-02-2005, 03:14 PM   #3
mentality
Junior Member
 
Join Date: May 2005
Posts: 14
Default

regsub what? {/} {//} {///} {/////}

bit infalted dont u think, and im sure if it wasnt useful, it wouldnt be part of unix. but, i guess you're bored.

heres an example:

mkd from site root, pwd is therefore: /
mkd /0day/1224/test
io args: MKD /0day/1224/test
glue em together //0day/1224/test

u can do:

Code:
set pwd /[string trim [string trim $pwd /]/[string trim [lrange $args 1 end] /] /]
but waste of time if hardcoded, just a req, not lifestyle decision, matey.
mentality is offline   Reply With Quote
Old 06-02-2005, 04:31 PM   #4
neoxed
Too much time...
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: May 2003
Posts: 1,326
Default

Quote:
Originally posted by mentality
regsub what? {/} {//} {///} {/////}

bit infalted dont u think, and im sure if it wasnt useful, it wouldnt be part of unix. but, i guess you're bored.
Last I checked, ioFTPD is written for Windows, not UNIX (or any of its equivalents). If you were to argue your point, perhaps you should reference Windows software instead. Using Windows explorer, try to access "C:\\\\\Windows" – you will find that only “C:\Windows” works (at least on XPSP2). Now of course, this behavior is not consistent with _all_ Microsoft applications.
Quote:
Originally posted by mentality
u can do:

Code:
set pwd /[string trim [string trim $pwd /]/[string trim [lrange $args 1 end] /] /]
I'm sorry, but that example code is just ugly and not practical. You could look into Tcl's 'file normalize' function, which canonicalizes the given path (beware; this function has a few subtleties).

Or even a simple regular expression replacement would suffice (as tuff mentioned):
Code:
regsub -all {[\\/]+} $dirPath {/} dirPath
neoxed is offline   Reply With Quote
Old 06-02-2005, 06:02 PM   #5
darkone
Disabled
FlashFXP Registered User
ioFTPD Administrator
 
darkone's Avatar
 
Join Date: Dec 2001
Posts: 2,230
Default

I think it should be able to do that.. I might be wrong though Now that I remember, path resolver is one of the few things left that I have not yet touched. It needs to be rewritten to support unicode... which is something I will have to do, after I'm done with rewriting the php extension
darkone is offline   Reply With Quote
Old 06-02-2005, 06:32 PM   #6
mentality
Junior Member
 
Join Date: May 2005
Posts: 14
Default

@neoxed, just bcos there is differences between windows and unix, doesn't mean they arent useful features to have.

@darkone, i've tried resolving pwd's with //etc//e/t, returns "", i think its a nice feature to have built in, just my 2 cents...
mentality is offline   Reply With Quote
Old 06-02-2005, 08:10 PM   #7
darkone
Disabled
FlashFXP Registered User
ioFTPD Administrator
 
darkone's Avatar
 
Join Date: Dec 2001
Posts: 2,230
Default

That's rather odd, because I think that on-site those paths should work without problems? And it's using the same algorithm for resolving... really odd
darkone is offline   Reply With Quote
Old 06-02-2005, 08:51 PM   #8
mentality
Junior Member
 
Join Date: May 2005
Posts: 14
Default

indeed, if i mkd via cmd line with '//////test' io will make 'test' in root
mentality is offline   Reply With Quote
Reply

Tags
/pwd/here/etc/etx, equal, pwd, resolve, tcl

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:15 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)