Solved

UNIX FileSize

Posted on 2006-10-28
2
246 Views
Last Modified: 2010-05-18
Hi...

My application is running on Windows OS and opening file with TFileStream readonly. The file wich my app is opening is on UNIX. Using SAMBA. Its does read the file, but sometimes, there is problem reading it, the file size doesn't change sometimes, but i'm sure there has been changes in file.

If i goto to that directory with Explore, my app notices when file size has been changed.

So what i'm interesting in. How to send command to windows to refresh that dir. I think there should be some kind of shell function in shell32.dll. wich refresh the directory.

In short sentences, i need to refresh directoy so i could notice changes in file size. Why i'm thinking about shell function? Becouse app notices the changes in file size, when i go into that directory with explorer.

So
my app runs on Windows OS
file is located on UNIX
i'm using SAMBA to be able to read file from UNIX.

thanks.
0
Comment
Question by:Kristao
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 26

Accepted Solution

by:
Russell Libby earned 215 total points
ID: 17825676
You could try the following, which is used to notify the shell of changes to a given path.

  // Uses ShlObj in the uses clause
  //
  // Example for refreshing the path "c:\windows". Change the path to your
  // desired path.
  //

  SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATH, PChar('c:\windows'), nil);

----

Regards,
Russell
0
 
LVL 1

Author Comment

by:Kristao
ID: 17844372
Tried some tests and looks like its does work.

thx
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question