This is an alternative to mfs_ftp.tcl that began as a replacement written in C and based on oftpd. After adding uploading ability it made more sense to optimize the mfs_* calls and keep the ftp code in tcl. Along the way I added another file type (tmf+) which is meant to solve the bookmark juggle problem in mfs_ftp by sending the master block of the ty file at the beginning of the upload. Anyhow, this alternative should be fairly stable and fixes some flaws I found when trying to use mfs_ftp.tcl.
New Version: 1.9
Code:################################################################################ # tyFTPd - Copyright (C) 2012 jkozee # # This program is distributed WITHOUT ANY WARRANTY; without even the implied # # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # # # TERMS OF USE: personal (noncommercial) fair-use backup & restore # # This software may not be used for copyright infringment or any illegal # # purpose, bundled with any product, sold, distributed or redistributed # # under any circumstances on any media without express written consent. # ################################################################################ # History: 1.9 20130113 Fixed missing quote as noted by tas3086. # # History: 1.8 20120729 Catch and log TransactionRetry attempts. # # History: 1.7 20120717 Fixed a bug related to not clearing CleanupStart when # # doing multiple STOR in a single client connection. # # History: 1.6 20120715 Changed the routines that call AddPart to use 64-bit # # values by using wide(). This may break compatibility # # with older units, however it allows for parts larger # # than 2GB to be created. Disable it by using # # "set GlobalData(fUseWide) 0" # # History: 1.5 20120710 Fixed a bug that would crash when a TmsID exists in # # the GuideIndex, but the object no longer exist int the # # mfs database. # # History: 1.4 20120709 Added real station and npk support. # # Updated tyftpd station to be reusable. # # Fixed a bug that would not handle maxSTOR correctly. # # History: 1.3 20120627 Fixed errors in UpdateParts. # # Fixed handling of tmf+ file uploads. Using this file # # type allows for initial allocation of all parts, which # # means the playbar is accurate almost immediately. # # Added -M flag to only list the tmf+ directory. # # Added code to handle incomplete STOR operations # # better. Now it removes unused parts and nulls out # # portions of the final part to hide the junk data that # # may exist due to using streamcreate vs streamfill. # # History: 1.2 20120610 Added -p and -c items to usage text. # # Added TYPE for better EOL handling (FlashFXP). # # Now using unified mfs32/64 code for mfs_ftp_helper. # # Added -m flag to only list the tmf directory. # # Added daemonize code unless loging to the screen. # # Added code to set Parts Begin/End attribute set. # # WARNING: tmf+ type handling suspect - DO NOT USE # # History: 1.1 20111118 Fixed changed list EOLs to CRLF to support FlashFXP # # Added [-p #] flag to change the listening port # # Added [-c] to cleanup incomplete recordings on startup # # The default behavior is to not cleanup so startup is # # much quicker. The -c flag is only needed if tyFTPd # # was aborted/died during upload. # # History: 1.0 20110815 Initial release. # # # # Purpose: This script is an alternative to mfs_ftp.tcl. It began as an # # experiment inspired by mfs_ftp.tcl and written in C based on oftpd # # and linked to the mfs_utils library to see if I could improve # # download speeds. Eventually I added upload abilities which # # required a tcl based server to handle the mfs objects. At that # # point I decided to just rewrite it all in tcl. This code has a # # advantages over mfs_ftp.tcl. # # 1) All of the required mfs_* functions are contained in a singe # # executable and is the only other required file (included). # # 2) Faster directory listings without caching. # # 3) The directory listings are sent as they are being gathered # # instead of leaving the client waiting while they are gathered # # 4) More complete mfs object creation including series creation to # # preserve folders on upload. # # 5) Better error handling, especially when uploads are aborted they # # are marked as completed and the recording status is stopped. # # 6) Forced the FSID to be part of the filename to assure that the # # correct file is downloaded/deleted from the client. # # # # Usage: -c Cleanup incomplete recordings from prior instance # # -d Include debug log information # # -l Log to /var/log/tyFTPd.log # # -m Only list tmf directory # # -M Only list tmf+ directory # # -p Port to listen on (Default is 5013) # # -s Log to the Screen # # -v Inlcude verbose log information # # -x Limit the reported filesize to 2GB for poorly written # # clients (LeechFTP) # # # # Important: Make sure that you update mfs_ftp_helper with each new release. # # It is now using the unified mfs-utils 32/64 version. # # # # Notes: Portions of this code based on, borrowed from, or inspired by # # other projects found on DDB, including TWP, mfs_ftp, etc. I only # # tested this on S3/11.0k and S2.5/7.2.2, probably needs tweaked for # # DTiVos. # # # # MovieLoader: If you are using this with MovieLoader make sure you are using # # MovieLoader.v0.17c.zip or later. You should change the port # # for tyftp by using the -p 3105. # # # ################################################################################


Reply With Quote



Now I can connect to the server on my THD. But there is no show listed while the original mfs_ftp correctly shows two. Any idea what is wrong? Thanks for your help.
