LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-31-2009, 07:34 PM   #1
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Rep: Reputation: 40
sftp not flushing files


Hi group,

I have this suite of program that use threads and fork/exec calls.
The programs now run OK with a major problem, the problem is that
sftp does not flush the output file buffer in a timely matter.
Here is a general description of how things work:
  1. client starts thread to connect to server
  2. client starts sftp using pseudo ttys.
  3. client start thread to process sftp output
  4. client start thread to process console input
  5. client start thread to process server messages
  6. client waits for files names from server
  7. when filename comes in send, transfer request to sftp
  8. when sftp outputs it is done, call file processor with filename
  9. return to wait.
The problem is that the first filename is processed just fine. All the next filename get errors while being processed. If I add a sleep(1) delay before calling the file processor, everything works, but there is an added wait! This is a real time program and I can't afford the extra delay.

I tried adding a 'sync()', that did not help.

My question is, how can I force sftp to flush his buffer sooner??

Thanks for your time.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
able to sftp files. what about directories? bowie101 Linux - Newbie 3 05-11-2006 12:04 AM
sftp automation for downloading files chipix Linux - Security 5 07-14-2004 05:57 AM
how to grab multiple files at the same time in SFTP? HiOctane21 Programming 1 05-02-2004 01:32 AM
Files truncated by sftp/sftp-server at 65kb gato Linux - Networking 1 12-18-2003 10:29 AM
sftp users can remove files without permission tunedLow Linux - Networking 6 03-06-2003 03:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration