CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/rex/ntpath.rb
Views: 11766
1
# frozen_string_literal: true
2
3
module Rex
4
module Ntpath
5
6
# @param [String] path The path to convert into a valid ntpath format
7
def self.as_ntpath(path)
8
Pathname.new(path)
9
.cleanpath
10
.each_filename
11
.drop_while { |file| file == '.' }
12
.join('\\')
13
end
14
end
15
end
16
17