equal
deleted
inserted
replaced
147 try { Some(Dir_Entry(expand_path(path), channel.stat(remote_path(path)))) } |
147 try { Some(Dir_Entry(expand_path(path), channel.stat(remote_path(path)))) } |
148 catch { case _: SftpException => None } |
148 catch { case _: SftpException => None } |
149 |
149 |
150 def is_file(path: Path): Boolean = stat(path).map(_.is_file) getOrElse false |
150 def is_file(path: Path): Boolean = stat(path).map(_.is_file) getOrElse false |
151 def is_dir(path: Path): Boolean = stat(path).map(_.is_dir) getOrElse false |
151 def is_dir(path: Path): Boolean = stat(path).map(_.is_dir) getOrElse false |
|
152 |
|
153 def mkdirs(path: Path): Unit = |
|
154 if (!is_dir(path)) { |
|
155 session.execute( |
|
156 "perl -e \"use File::Path make_path; make_path('" + remote_path(path) + "');\"") |
|
157 if (!is_dir(path)) error("Failed to create directory: " + quote(remote_path(path))) |
|
158 } |
152 |
159 |
153 def read_dir(path: Path): List[Dir_Entry] = |
160 def read_dir(path: Path): List[Dir_Entry] = |
154 { |
161 { |
155 val dir = channel.ls(remote_path(path)) |
162 val dir = channel.ls(remote_path(path)) |
156 (for { |
163 (for { |