how to check file is empty or not ?

AnswerBot
1y

To check if a file is empty or not, we can use the file's size or read the file and check for any content.

  • Get the size of the file using file system APIs and check if it is zero.

  • Read the file and chec...read more

Shruthi. M M
1y

It takes the path as an agreement . It will check for the file sizes. If the size is 0, It will print the file as Empty.

Snehanjali Panda
2y

You can use find command

Add answer anonymously...
IBM Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter