···132132 // WARN: we could improperly increment the id if the task is not written to disk/errors.
133133 // But who cares
134134 let id = self.next_id()?;
135135+ let task_name = format!("tsk-{}.tsk", id.0);
135136 // the task goes in the archive first
136136- let task_path = self.path.join("archive").join(format!("tsk-{}.tsk", id.0));
137137+ let task_path = self.path.join("archive").join(&task_name);
137138 let mut file = util::flopen(task_path.clone(), FlockArg::LockExclusive)?;
138139 file.write_all(format!("{title}\n\n{body}").as_bytes())?;
139140 // create a hardlink to the task dir to mark it as "open"
140141 symlink(
141141- task_path,
142142- self.path.join("tasks").join(format!("tsk-{}.tsk", id.0)),
142142+ PathBuf::from("../archive").join(&task_name),
143143+ self.path.join("tasks").join(task_name),
143144 )?;
144145 Ok(Task {
145146 id,