({{, (RefLink[FileByteCount, paclet:ref/FileByteCount])[file]
gives the number of bytes in a file. }})

OpenersNotesSection(Spacer1)Details

The file in (RefLink[FileByteCount, paclet:ref/FileByteCount]) can be specified by giving the path to the file as a string or a (RefLink[File, paclet:ref/File]) object.

If a particular file is moved from one computer system to another, the number of bytes in the file as reported by (RefLink[FileByteCount, paclet:ref/FileByteCount]) may change.

(RefLink[FileByteCount, paclet:ref/FileByteCount]) also works with cloud objects.

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

The number of bytes in a file:

FileByteCount[$InstallationDirectory<>"/Documentation/English/System/ExampleData/ocelot.jpg"]

OpenersExampleSection1(Spacer1)Scope  (1)

Get the number of bytes in the file specified by the (RefLink[File, paclet:ref/File]) object:

FileByteCount[File[$InstallationDirectory<>"/Documentation/English/System/ExampleData/ocelot.jpg"]]

OpenersExampleSection2(Spacer1)Properties & Relations  (1)

(RefLink[FileSize, paclet:ref/FileSize]) gives the same number of bytes as (RefLink[FileByteCount, paclet:ref/FileByteCount]):

FileByteCount[FindFile["ExampleData/ocelot.jpg"]]

FileSize[FindFile["ExampleData/ocelot.jpg"]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[FileSize, paclet:ref/FileSize])  ▪  (RefLink[StringLength, paclet:ref/StringLength])  ▪  (RefLink[FileHash, paclet:ref/FileHash])  ▪  (RefLink[FileType, paclet:ref/FileType])  ▪  (RefLink[FileDate, paclet:ref/FileDate])  ▪  (RefLink[BinaryReadList, paclet:ref/BinaryReadList])  ▪  (RefLink[FileSystemMap, paclet:ref/FileSystemMap])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Manipulating Files and Directories, paclet:tutorial/ManipulatingFilesAndDirectories])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[File Operations, paclet:guide/FileOperations])}})}})