os.path.getctime
Watching for files that just got written
- path_in
- ctime
The name says "ctime," which most people read as "creation time." It isn't, exactly. On Unix this is the time the file's metadata last changed - chmod, rename, link count, ownership - and on Windows it's genuinely the creation time. ComfyUI doesn't have a "wait for my video to finish writing" node, but ctime is one of the ingredients you'd use to build that check yourself, and this node hands it to you as a plain number.
It's part of the ovum/path/os.path family in comfy-ovum, sfinktah's "custom nodes I couldn't live without" grab-bag. The whole family is a set of thin wrappers over Python's stdlib os.path functions, which means the behavior is exactly what Python would give you - no reinvention, no surprise round-trip. That's the point: you get os.path.getctime() inside your graph without dropping to a Python node or a shell call.
How it works
The node takes a path, feeds it to os.path.getctime(), and returns the result as a FLOAT (ctime). That float is seconds since the Unix epoch, because that's what the stdlib returns. Nothing is cached specially, no state is kept, and there's no timing input - it reads the file's current ctime at execution time, so if you run the workflow twice you get fresh values.
You give it the path one of two ways:
- path (STRING, required): the widget. Type the path directly.
- path_in (PATHLIKE,STRING, optional): a link-only input. If you wire something into it, it wins over the widget. It accepts either a plain string or a PATHLIKE object from the pack's "STRING to PATHLIKE (PurePath)" node, which is the same mechanism every node in this family shares.
One output: ctime as FLOAT.
Where you'd actually use it
The realistic pattern is a change-detector: wire a saver's output path in, run OvumOsPathGetCtime twice across two passes of your workflow (comfy-ovum's environment-variable or list nodes are handy for carrying the earlier value), and compare. When the ctime moves, the file was rewritten - that's your "it's finished, go process it" trigger for an automation-style graph. Pair the FLOAT with a compare or a Python String Format node if you want to print it as a human timestamp.
Installing it
Install the pack once via ComfyUI Manager (search "comfy-ovum", install, restart), or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
No model downloads, no heavy deps - these path nodes are pure stdlib wrappers and don't pull in anything beyond what ComfyUI already has. The pack's requirements.txt lists extras like pymediainfo that serve other nodes in it, not this one.
Gotchas
- The path must exist.
getctimeraisesFileNotFoundErrorif the file isn't there - unlike theis*predicates in this family, which just returnFalse. There's no try/except in the node, so a missing path fails your run. Check withos.path.isfilefirst if there's any doubt. - On Unix, a newly written file that's had its metadata touched (like a rename into the output folder) shows that rename as its ctime - which is usually exactly what you want for "this file changed" logic, but it means ctime can change when mtime doesn't.
If all you want is "when was this file last modified," you want the sibling os.path.getmtime node instead. If you want "does the file even exist," that's os.path.isfile. ctime is the one you reach for when you're building file-watching logic and need to know if something changed, not just when it was edited.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | — | |
| path_inopt | PATHLIKE,STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| ctime | FLOAT | — |