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

Changeset 3469

Show
Ignore:
Timestamp:
04/27/08 13:45:00 (7 months ago)
Author:
lmartin92
Message:

MLST works now(or if fails goes back to regular LIST)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/lmartin/ftp/tango/net/ftp/FtpClient.d

    r3467 r3469  
    756756                // Try to pull out the (possibly not parenthesized) address. 
    757757                auto r = Regex(`\([^0-9][^0-9][^0-9](\d+)[^0-9]\)`); 
    758                 debug(UnitTest) 
    759                 { 
    760                     Stdout(response.message).newline.flush; 
    761                     Stdout(response.message[0 .. find(response.message, '\n') ]).newline.flush; 
    762                 } 
    763758                if ( !r.test(response.message[0 .. find(response.message, '\n') ])) 
    764759                    throw new FtpException("CLIENT: Unable to parse address", "501"); 
     
    777772                auto response = this.readResponse("227"); 
    778773 
    779                 debug(UnitTest) 
    780                 { 
    781                     Stdout(response.message).newline.flush; 
    782                     Stdout(response.message[0 .. find(response.message, '\n') ]).newline.flush; 
    783                 } 
    784774                // Try to pull out the (possibly not parenthesized) address. 
    785775                auto r = Regex(`(\d+),\s*(\d+),\s*(\d+),\s*(\d+),\s*(\d+)(,\s*(\d+))?`); 
     
    932922 
    933923        // Try it if it could/might/maybe is supported. 
    934         /*if (this.isSupported("MLST")) 
     924        if (this.isSupported("MLST")) 
    935925            { 
    936926                mlsd_success = true; 
     
    964954                    { 
    965955                        // Parse each line exactly like MLST does. 
    966                         FtpFileInfo info = this.parseMlstLine(line); 
    967                         if (info.name.length > 0) 
    968                             dir ~= info; 
     956                        try 
     957                        { 
     958                            FtpFileInfo info = this.parseMlstLine(line); 
     959                            if (info.name.length > 0) 
     960                                dir ~= info; 
     961                        } 
     962                        catch(FtpException) 
     963                        { 
     964                            return this.sendListCommand(path); 
     965                        } 
    969966                    } 
    970967 
     
    972969            } 
    973970        // Fall back to LIST. 
    974         else*/ 
     971        else 
    975972            return this.sendListCommand(path); 
    976973    } 
     
    12681265        if (filename_pos == line.length) 
    12691266            throw new FtpException("CLIENT: Bad syntax in MLSx response", "501"); 
     1267            /*{ 
     1268                info.name = ""; 
     1269                return info; 
     1270            }*/ 
    12701271 
    12711272        info.name = line[filename_pos .. line.length];