Comments (4)
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.
@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.
@wconrad, thanks for your help.
I will try to build FTPD by this sample .
from ftpd.
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)
- Unable to reuse same port after stopping server HOT 6
- #stop causes "Errno::ENOTCONN: Socket is not connected" in OSX HOT 8
- Connection Hangs on "ls" HOT 3
- Add more handlers
- Tests fail under Ruby >= 2.2.3 HOT 2
- External IP HOT 7
- [IMPROVEMENT] Cmd Size and exotic filesystem
- forwarding to private method XXX HOT 3
- FTPPermError 550 Access Denied. HOT 2
- FTP base path lack of trailing `/` results in denial of service and disclosure of the local file system path HOT 1
- add bindir in gemspec HOT 2
- ftpd windows version , the ftp server will crash if input 'dir' HOT 1
- Using ruby 2.4 fails HOT 3
- Modernize usage of File.dirname(__FILE__) to support symlinks HOT 1
- CPU usage pegged at 100% HOT 9
- rake test:features seems to be broken HOT 2
- Issue with TLS protocol
- Error Connection reset by peer @ io_fillbuf - fd:158
- Update testing to use newer Ruby versions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ftpd.