当前位置: 首页>>代码示例>>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;未经允许,请勿转载。