# Relative path folder with "#" will show error "File names cannot end in dots or spaces" or generate new file

**URL:** <https://forum.obsidian.md/t/relative-path-folder-with-will-show-error-file-names-cannot-end-in-dots-or-spaces-or-generate-new-file/88572>\
**Category:** Bug graveyard\
**Tags:** internal-links\
**Created:** [September 18, 2024, 6:40am UTC](https://forum.obsidian.md/t/relative-path-folder-with-will-show-error-file-names-cannot-end-in-dots-or-spaces-or-generate-new-file/88572 "2024-09-18T06:40:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tp1415926535](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@tp1415926535](https://forum.obsidian.md/u/tp1415926535)\
**Post date:** [September 18, 2024, 6:40am UTC](https://forum.obsidian.md/t/relative-path-folder-with-will-show-error-file-names-cannot-end-in-dots-or-spaces-or-generate-new-file/88572/1 "2024-09-18T06:40:12Z")

</div>

### Steps to reproduce

1. “New link format” set to `Relative path to file` in “Files and links” Settings .
2. create a folder named “C#”, and create a note named “Target” in the folder.
3. create a folder named “Other” , and create a note named “Test” in the folder:

```auto
[Target](../C#/Target.md)

```

1. create a note named “Test2” in root folder.

```auto
[Target](C#/Target.md)

```

The directory structure now looks like this:

```auto
│ Test2.md
├─C#
│ Target.md
└─Other
        Test.md

```

If you click the link in the `Test.md`, it will show error `File names cannot end in dots or spaces`.  
If you click the link in the `Test2.md`, it will create a note named “C” in root folder.

### Did you follow the [troubleshooting guide](https://forum.obsidian.md/t/about-the-bug-reports-category/24/10)? [Y]

### Expected result

> Relative paths should match files first, not the first ‘#’.

### Actual result

> it seems to be looking for the ‘/Target.md’ header inside the “C” note in the root directory, which doesn’t make sense.

### Environment

```auto
SYSTEM INFO:
	Obsidian version: v1.6.7
	Installer version: v1.6.7
	Operating system: Windows 10 Pro 10.0.19045
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

```

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [September 18, 2024, 2:57pm UTC](https://forum.obsidian.md/t/relative-path-folder-with-will-show-error-file-names-cannot-end-in-dots-or-spaces-or-generate-new-file/88572/2 "2024-09-18T14:57:06Z")

</div>

This is part of broader issues/not yet implemented features around relative links (especially important with standard markdown links in relative path mode).

> [@In relative path mode (path from current file), always add \`./\` and \`../\` in front of links](https://forum.obsidian.md/t/in-relative-path-mode-always-add-in-front-of-links-for-files-in-subdirectories-relative-to-the-current-file/25063):
>
> In relative path mode, always add ./ in front of links for files in subdirectories relative to the current file and ../ for files in subdirectories above the current file. This is particularly important since Obsidian doesn’t use a front / in absolute path mode and this creates confusion and ambiguity.

> [@Obsidian has trouble creating new notes from "Relative path to file" links](https://forum.obsidian.md/t/obsidian-has-trouble-creating-new-notes-from-relative-path-to-file-links/3741):
>
> Steps to reproduce Set “New link format” in File preferences to “Relative path to file.” Create a new link with a relative format (this has to be done manually, as the file doesn’t exist yet so Obsidian can’t guess your desired folder path. E.g., ../Calendar/20200803 Try to create a new note from the link Cry Expected result Successful creation of the new file in the expected directory. Actual result An ENOENT error. Environment Operating system: macOS 10.15 Obsidian version: 0.…

> [@Broken links in relative path mode on move/rename](https://forum.obsidian.md/t/broken-links-in-relative-path-mode-on-move-rename/4386):
>
> In Relative-path mode, relative links should be updated when: a linked file is moved (done!) AND a note that contains the link is moved (to-do!). EDIT: Added minimal example: Have foo.md and bar.md in the root of the vault. With foo.md containing [[bar]] move foo.md to /subdir Expected foo.md content: [[../bar]] Actual [[bar]] Same problem applies to standard markdown links.

Also we don’t support filepaths with `#` in links.

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [September 25, 2024, 2:57pm UTC](https://forum.obsidian.md/t/relative-path-folder-with-will-show-error-file-names-cannot-end-in-dots-or-spaces-or-generate-new-file/88572/3 "2024-09-25T14:57:27Z")

</div>

Closed on September 25, 2024, 2:57pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
