Git Product home page Git Product logo

Comments (4)

wconrad avatar wconrad commented on July 24, 2024

Hi Simon. It should be possible--everything FTPD knows about the file system and how to interact with it comes from a class that you provide. That class can pretend there's nothing to read, take writes and do some operation, etc.

You would make a "file system driver" class that behaves like you need it to:

class FileSystemDriver
  ...
end

Your Driver class will call the #file_system method, which returns your special driver:

class Driver
  ...
  def file_system(user)
    FileSystemDriver.new
  end
  ...
end

When you start FTPD, provide an instance of your driver:

...
driver = Driver.new
server = Ftpd::FtpServer.new(driver)
server.start
...

All of the hard work is inside of FileSystemDriver. There is more in the README about how a FileSystemDriver needs to behave.

I hope this helps.

from ftpd.

wconrad avatar wconrad commented on July 24, 2024

@simon435500, I've created an example of a write-only file system for FTPD: https://github.com/wconrad/ftpd/blob/master/examples/write_only.rb

You can put any code you like in the file system driver's #write method

from ftpd.

simon435500 avatar simon435500 commented on July 24, 2024

@wconrad, thanks for your help.
I will try to build FTPD by this sample .

from ftpd.

wconrad avatar wconrad commented on July 24, 2024

I'll close this issue, but if the above suggestions did not work for you, please feel free to open another issue.

from ftpd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.