# Do do I get the absolute path of a file in the file system? #obsidian/api/faq --- TL;DR - use `vault.getResourcePath()`. --- It might be tempting to use `FileSystemAdapter.getFullPath`. You'll quickly notice that `Vault.adapter` gives you `DataAdapter` and not a `FileSystemAdapter`. That's weird, right? You're probably tempted to cast it. Well, hold your horses. With mobile apps right around the corner, you can't assume `vault.adapter` will always be an instance of `FileSystemAdater`. One option is to check the type of your adapter first with `instanceof`. ## Sample Code (`getFullPath`) ```ts // Note: in the future, the vault adapter could point to a // mobile device's file system. Check the type of the adapter // first so that the plugin is forward-compatible. if (vault.adapter instanceof FileSystemAdapter) { const absolutePath = vault.adapter.getFullPath(file); } else { // Okay, it's a mobile filesystem, now what? } ``` ## Sample Code (`getResourcePath`) There's a simpler option that will also be future-compatible with mobile filesystem adapters: `Vault.getResourcePath`. ```ts const absolutePath = vault.getResourcePath(myFile); ```