<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/i-exist-8f1gyicqp" -->

---
title: I Exist | daily.dev
description: A developer working in Delphi/Pascal traced a baffling bug where FileExists incorrectly reported that existing files didn't exist. The root cause: FileExists...
canonical: https://daily.dev/posts/i-exist-8f1gyicqp
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: I Exist | daily.dev
og:description: A developer working in Delphi/Pascal traced a baffling bug where FileExists incorrectly reported that existing files didn't exist. The root cause: FileExists...
og:url: https://daily.dev/posts/i-exist-8f1gyicqp
og:image: https://api.daily.dev/og/posts/8f1gyIcQp.png
og:image:alt: I Exist
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I Exist

**[The Daily WTF](https://daily.dev/sources/thedailywtf)** · 2 min read · 0 upvotes · 0 comments

## Summary

A developer working in Delphi/Pascal traced a baffling bug where FileExists incorrectly reported that existing files didn't exist. The root cause: FileExists relies on FileAge, which relies on the Windows API function FileTimeToDosDateTime to compute a timestamp; if the file's last-write time wasn't set by the process that created it, the conversion fails and its returned error code goes unchecked, causing FileAge to return -1 and FileExists to falsely report the file as missing.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://thedailywtf.com/articles/i-exist>

## Questions this post answers

### Why does Delphi's FileExists function sometimes return false for a file that actually exists?

FileExists in Delphi's Windows implementation calls FileAge, which relies on the Win32 API function FileTimeToDosDateTime to convert the file's last-write time. If the process that created the file never set a valid last-write timestamp, that conversion fails and returns an error code, but the code is never checked. FileAge then returns -1, which FileExists interprets as the file not existing.

_Debugging file-detection quirks in legacy Delphi code gets easier with developer discussions curated on daily.dev._

## Similar posts on daily.dev

- [Repeating Your Existence](https://daily.dev/posts/repeating-your-existence-upikvdlqs) · The Daily WTF · 2 upvotes · 0 comments
- [September 23, 2026](https://daily.dev/posts/september-23-2026-r0obhdm3j) · The Old New Thing · 0 upvotes · 0 comments
- [September 21, 2026](https://daily.dev/posts/september-21-2026-bxetzqeen) · DevBlogs · 0 upvotes · 0 comments
- [Remaking the Linux "touch" command in PowerShell](https://daily.dev/posts/remaking-the-linux-touch-command-in-powershell-d36vgaylg) · Cassidy's blog · 3 upvotes · 1 comments

---

[View this post on daily.dev](https://daily.dev/posts/i-exist-8f1gyicqp)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"I Exist","url":"https://daily.dev/posts/i-exist-8f1gyicqp","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/i-exist-8f1gyicqp"},"datePublished":"2026-09-14T11:41:54.629Z","dateModified":"2026-09-14T11:42:10.859Z","description":"A developer working in Delphi/Pascal traced a baffling bug where FileExists incorrectly reported that existing files didn't exist. The root cause: FileExists...","image":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","thumbnailUrl":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","isAccessibleForFree":true,"articleSection":"The Daily WTF","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"The Daily WTF","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/d21a6aa61a7244d893a3b3284df8e2ef","url":"https://daily.dev/sources/thedailywtf"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/i-exist-8f1gyicqp","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"The Daily WTF","item":"https://daily.dev/sources/thedailywtf"},{"@type":"ListItem","position":3,"name":"I Exist"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/i-exist-8f1gyicqp#faq","mainEntity":[{"@type":"Question","name":"Why does Delphi's FileExists function sometimes return false for a file that actually exists?","acceptedAnswer":{"@type":"Answer","text":"FileExists in Delphi's Windows implementation calls FileAge, which relies on the Win32 API function FileTimeToDosDateTime to convert the file's last-write time. If the process that created the file never set a valid last-write timestamp, that conversion fails and returns an error code, but the code is never checked. FileAge then returns -1, which FileExists interprets as the file not existing. Debugging file-detection quirks in legacy Delphi code gets easier with developer discussions curated on daily.dev."}}]}
```

