Delphi Check File Size

Posted on by admin

Else ShowMessage('File is not archived'); if attrs and faSymLink > 0 then ShowMessage('File is a symbolic link') else ShowMessage('File is not a symbolic link'); end; Show full unit code: File is not read only File is not hidden File is not a system file File is not a Volume ID File is not a directory File is archived File is not a symbolic link. Delphi Spell Checker PRO, award-winning Spell Checking Add-in for Borland Delphi (Delphi Expert). Check Spelling in forms, hints, TStrings and captions in 18 languages, using 26 dictionaries, right in your Delphi 6-7 IDE. In Delphi code, call FileSize to determine the size of the file specified by the file variable F. The size is expressed as the number of records in a record file. Thus: If the file is declared as a file of byte, then the record size defaults to one byte, and FileSize returns the number of bytes in the file.

  1. Delphi Check File Size Windows 10
  2. Windows Check File Size
  3. Java Check File Size
  4. Delphi Check File Size Online
Active8 years, 4 months ago

My app contains documents in its database. The users can open the documents in which case, the document gets saved to a temporary folder and gets opened on the user's computer.

File

I'd like to get a notification when one of these temporary files are changed, and offer the user to save the changed document back to the database.

What is the most simple way to do this in Delphi7? (I suppose it requires some shell magic or 3rd party component)

Thanks!

RRUZ
125k13 gold badges314 silver badges446 bronze badges
SteveSteve
1,3112 gold badges22 silver badges47 bronze badges

4 Answers

You can either:

  1. use the Win32 API SHChangeNotifyRegister function to watch for changes in the temp folder, and then have your callback check if your temporary files are reporting changes.

  2. since you know the exact file(s) you are interested in, you can manually monitor them directly for changes to their sizes and timestamps using FindFirstFile in a timer or thread.

    2016-3-29  2020 Cloud is an innovative way to access catalog content in 2020 Design kitchen and bathroom software. Just start the application and get immediate access to thousands of items directly from the new 2020 Cloud browser. 20 20 kitchen cabinet design software. 2019-1-18  2020 offers the best kitchen design software and 3D bathroom planner in the market. With superior 3D rendering capabilities, advanced planning tools, 360 panoramic views, floor planners, and access to an array of decorative items, 2020 applications are equipped with everything designers and remodeling professionals need to create fully functional and beautiful bathroom and kitchen layouts. 20 20 Kitchen Design Software Kitchen Design Software v.3.1 Kitchen Design Software is technical kitchen design software capable to draw different room layouts, floor.

Delphi Check File Size Windows 10

Remy LebeauRemy Lebeau
360k21 gold badges287 silver badges486 bronze badges

You can detect changes in your temporary files (or any file) using the TJvChangeNotify component from the JEDI JVCL collection.

RRUZRRUZ
125k13 gold badges314 silver badges446 bronze badges

In addition to what RRuz and Remy Lebeau wrote:

Note that TJvChangeNotify in the JvChangeNotify unit makes use of the FindFirstChangeNotification API call; this is the MSDN documentation. Note it is a bit counter-intuitive: see the thread mentioned below on how to use it inside a while loop.

There is also the ReadDirectoryChanges API call, which is not wrapped by the JCL/JVCL, and has MSDN documentation here and there is a Delphi win32 example as well.

This thread explains the differences between the two API calls.

--jeroen

Dvd decoding software

Community
Jeroen Wiert PluimersJeroen Wiert Pluimers
20.9k5 gold badges53 silver badges133 bronze badges

Also take a look at this: http://www.cromis.net/blog/downloads/directory-watch/ and How to monitoring directory for files in Delphi XE?

Windows Check File Size

Community
RobertFrankRobertFrank

Java Check File Size

5,3228 gold badges46 silver badges90 bronze badges

Delphi Check File Size Online

Not the answer you're looking for? Browse other questions tagged delphiwinapishellfile-iodelphi-7 or ask your own question.