• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

hofw to find weather the file is already red or not..

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all..

I had list of files, how can i find the file is already red or not... if red i need to go for next file else current one has to read..

Thanks....
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I assume you mean "read", not "red".

What does it mean for a file to have been read? Read by whom? In general it's not possible to find out whether a file has been read by some other process or not, unless special provisions are made for that.
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ulf Dittmer:
I assume you mean "read", not "red".





To add to what Ulf has told.
There is no straight forward way of knowing whether some process/user has read a file or not.
If your program is the only one reading the file then you can create a dummy file in the same location that is created whenever you start reading it.
This will be useful when your code runs in multiple threads/processes (scanners for a directory) and you do not want a file to be processed more than once.
 
reply
    Bookmark Topic Watch Topic
  • New Topic