當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ftp.end函數代碼示例

本文整理匯總了TypeScript中ftp.end函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript end函數的具體用法?TypeScript end怎麽用?TypeScript end使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了end函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

 ftp.put(readStream, file.path, (err) => {
   if (err) {
     deferred.reject(err);
   }
   ftp.end();
   deferred.resolve({});
 });
開發者ID:chrisk-symphony,項目名稱:sy-trans,代碼行數:7,代碼來源:FTP.ts

示例2: alert

      client.list((err, list) => {
        if (err) console.error(err);

        console.dir(list);
        client.end();

        alert("Connection Successful");
      });
開發者ID:joedono,項目名稱:No-CI,代碼行數:8,代碼來源:ftp-upload.service.ts

示例3: function

 c.mkdir(remoteDirectory, true, function (err) {
     if (err) {
         c.end();
         failTask('Unable to create remote directory: ' + remoteDirectory + ' due to error: ' + err);
     }
     directoriesProcessed++;
     checkDone('remote directory successfully created/verified: ' + remoteDirectory);
 });
開發者ID:ColinDabritz,項目名稱:vsts-tasks,代碼行數:8,代碼來源:ftpuploadtask.ts

示例4: checkDone

function checkDone(message: string): void {
    var total: number = filesUploaded + filesSkipped + directoriesProcessed;
    var remaining: number = files.length - total + 1; // add one for the root remotePath
    console.log( 
        'files uploaded: ' + filesUploaded +
        ', files skipped: ' + filesSkipped +
        ', directories processed: ' + directoriesProcessed +
        ', total: ' + total + ', remaining: ' + remaining +
        ', '+message);
    if (remaining == 0) {
        c.end();
        tl.setResult(tl.TaskResult.Succeeded, 'FTP upload successful' + getFinalStatusMessage());
    }
}
開發者ID:ColinDabritz,項目名稱:vsts-tasks,代碼行數:14,代碼來源:ftpuploadtask.ts

示例5: resolve

 ftp.list(jdfPath, (err, list) => {
     if (err) {
         ftp.end();
         console.log(err);
         resolve(localStat);
     } else {
         const index = indexOfJdf(list);
         if (index >= 0) {
             const remoteStat = list[indexOfJdf(list)];
             if (localStat
                 && (localStat.size === parseInt(remoteStat.size)
                     && localStat.mtime.getTime() == remoteStat.date.getTime())) {
                 ftp.end();
                 resolve(localStat);
             } else {
                 ftp.get(remoteJdfPath, (err, stream) => {
                     if (err) {
                         ftp.end();
                         console.log(err);
                         resolve(localStat);
                     } else {
                         stream.once("close", () => {
                             ftp.end();
                         });
                         stream.pipe(fs.createWriteStream(localJdfPath).once("close", () => {
                             fs.utimesSync(localJdfPath, new Date, remoteStat.date);
                             resolve(getFileStat(localJdfPath));
                         }));
                     }
                 });
             }
         } else {
             ftp.end();
             resolve(localStat);
         }
     }
 });
開發者ID:graycrow,項目名稱:node-cisjr,代碼行數:37,代碼來源:index.ts

示例6:

    client.on('ready', () => {
      logger.emit('Connected to FTP Server');

      files.forEach((commitFile) => {
        if(commitFile.Status === 'A' || commitFile.Status === 'M') {
          logger.emit('Uploading: ' + rootPath + commitFile.FileName);
          logger.emit('To: ' + ftpRootFolder + commitFile.FileName);

          client.put(rootPath + commitFile.FileName, ftpRootFolder + commitFile.FileName, (err) => {
            if(err) {
              logger.emit('ERROR: ' + err);
            } else {
              logger.emit('Upload successful: ' + commitFile.FileName);
            }
          });
        }
      });

      client.end();
    });
開發者ID:joedono,項目名稱:No-CI,代碼行數:20,代碼來源:ftp-upload.service.ts


注:本文中的ftp.end函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。