Setting root folder problem (Windows)
See original GitHub issueHi,
I’m having problem setting the ftp root folder on Windows. Here is what I did :
const ftp_srv = require('ftp-srv');
const f = new ftp_srv("127.0.0.1:21", {});
f.on('login', ({ username, password }, resolveLogin, rejectLogin) => {
return resolveLogin({
root: "d:\\ftp_root",
cwd: "/"
});
)};
f.listen();
When the client is getting the file (LIST) the here is what I’m getting in fs.js
class FileSystem {
constructor(connection, {
root = '/',
cwd = '/'
} = {}) {
this.connection = connection;
this.cwd = nodePath.resolve(cwd); // "/" = "d:/"
this.root = nodePath.resolve(root); // "d:\\ftp_root" = "d:\ftp_root"
}
Now in the list
function :
list(path = '.') {
path = this._resolvePath(path); // path = "d:\ftp_rootd:\"
return fs.readdir(path)
.then(fileNames => {
Thus, d:\ftp_rootd:\
is not a valid folder on my host. Why the cmd
and the root
folder are merge together ? Why not use only the root
argument ?
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Changing Windows Setting Security on root folder returns ...
Open Windows Explorer, right-click on the affected drive, and click Properties ->Security (tab) -> [Advanced] -> Owner (tab) -> [Edit]. You ...
Read more >How to Locate the Root Folder for Microsoft
3. Type “echo %SYSTEMROOT%" at the command prompt and press “Enter.” The result of this search is the root folder for Microsoft Windows....
Read more >Locate the Windows system root directory - MCCI
Enter the command “set systemroot” at the prompt, and press enter, as shown below. The system will display the system root. (The first...
Read more >FIX: Write Access Denied on Drive C:\ - Windows Tips & How-tos
By design and for security reasons, Windows 10, 8 & Windows 7 don't allow users (even Administrators) to save files in the root...
Read more >How to locate the system root directory in Windows - Quora
A command window should appear. Enter the command "set systemroot" at the prompt, and press enter, as shown below. The system will display...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Wow, thank you so much Stewart, now it seems to work perfectly 😃
Okay this is fixed with https://github.com/stewarttylerr/ftp-srv/pull/12!