Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 315457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:17:36+00:00 2026-05-12T08:17:36+00:00

I got an application which is polling on a folder continuously. Once any file

  • 0

I got an application which is polling on a folder continuously. Once any file is ftp to the folder, the application has to move this file to some other folder for processing.

Here, we don’t have any option to verify whether ftp is complete or not.

One command “lsof” is suggested in the technical forums. It got a file description column which gives the file status.

Since, this is a free bsd command and not present in old versions of linux, I want to clarify the usage of this command.

Can you guys tell us your experience in file verification and is there any other alternative solution available?

Also, is there any risk in using this utility?

Appreciate your help in advance.

Thanks,
Mathew Liju

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T08:17:36+00:00Added an answer on May 12, 2026 at 8:17 am

    We’ve done this before in a number of different ways.

    Method one:

    If you can control the process sending the files, have it send the file itself followed by a sentinel file. For example, send the real file "contracts.doc" followed by a one-byte "contracts.doc.sentinel".

    Then have your listener process watch out for the sentinel files. When one of them is created, you should process the equivalent data file, then delete both.

    Any data file that’s more than a day old and doesn’t have a corresponding sentinel file, get rid of it – it was a failed transmission.

    Method two:

    Keep an eye on the files themselves (specifically the last modification date/time). Only process files whose modification time is more than N minutes in the past. That increases the latency of processing the files but you can usually be certain that, if a file hasn’t been written to in five minutes (for example), it’s done.

    Conclusion:

    Both those methods have been used by us successfully in the past. I prefer the first but we had to use the second one once when we were not allowed to change the process sending the files.

    The advantage of the first one is that you know the file is ready when the sentinel file appears. With both lsof (I’m assuming you’re treating files that aren’t open by any process as ready for processing) and the timestamps, it’s possible that the FTP crashed in the middle and you may be processing half a file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an application which has got some sensitive information. I am
I´m having some trouble deciding in which way to go... I've got this application
We've got a flash application which has started displaying some rather irritating behavior. Every
I've got an application which adds 10+ items to a treelist every second. This
I've got an application which opens a csv file and displays all the contents
I'm stuck on this problem here. I've got an application which reads out an
I've got an application which i want to send some alerts information. Currently, it's
I've got a file download application which I need to update progress using Asnc
I've got an application which records audio from the microphone and then performs some
In bare outlines, I've got an application which looks through the directories at startup

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.