1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 15:15:25 +02:00

Workaround bug 153118 - ssh hangs when trying to create empty file

This commit is contained in:
Martin Oberhuber 2006-08-08 16:57:01 +00:00
parent 80981eee1e
commit a604bc4c50

View file

@ -432,6 +432,9 @@ public class SftpFileService extends AbstractFileService implements IFileService
try {
String fullPath = remoteParent + '/' + fileName;
OutputStream os = getChannel("SftpFileService.createFile").put(fullPath); //$NON-NLS-1$
//TODO workaround bug 153118: write a single space
//since jsch hangs when trying to close the stream without writing
os.write(32);
os.close();
SftpATTRS attrs = getChannel("SftpFileService.createFile.stat").stat(fullPath); //$NON-NLS-1$
result = makeHostFile(remoteParent, fileName, attrs);