MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / libssh_open_file

Function libssh_open_file

libavformat/libssh.c:134–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134static av_cold int libssh_open_file(LIBSSHContext *libssh, int flags, const char *file)
135{
136 int access;
137
138 if ((flags & AVIO_FLAG_WRITE) && (flags & AVIO_FLAG_READ)) {
139 access = O_CREAT | O_RDWR;
140 if (libssh->trunc)
141 access |= O_TRUNC;
142 } else if (flags & AVIO_FLAG_WRITE) {
143 access = O_CREAT | O_WRONLY;
144 if (libssh->trunc)
145 access |= O_TRUNC;
146 } else
147 access = O_RDONLY;
148
149 /* 0666 = -rw-rw-rw- = read+write for everyone, minus umask */
150 if (!(libssh->file = sftp_open(libssh->sftp, file, access, 0666))) {
151 av_log(libssh, AV_LOG_ERROR, "Error opening sftp file: %s\n", ssh_get_error(libssh->session));
152 return AVERROR(EIO);
153 }
154
155 return 0;
156}
157
158static av_cold void libssh_stat_file(LIBSSHContext *libssh)
159{

Callers 1

libssh_openFunction · 0.85

Calls 1

av_logFunction · 0.85

Tested by

no test coverage detected