Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

UNIX FileSize

Posted on 2006-10-28
2
Medium Priority
?
251 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
2 Comments
 
LVL 26

Accepted Solution

by:
Russell Libby earned 860 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Integration Management Part 2
Screencast - Getting to Know the Pipeline
Suggested Courses

783 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