# Folderitem syntax

**URL:** <https://forum.xojo.com/t/folderitem-syntax/59623>\
**Category:** Windows\
**Created:** [December 8, 2020, 6:00pm UTC](https://forum.xojo.com/t/folderitem-syntax/59623 "2020-12-08T18:00:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Arissa](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@Allen\_Arissa](https://forum.xojo.com/u/Allen_Arissa)\
**Post date:** [December 8, 2020, 6:00pm UTC](https://forum.xojo.com/t/folderitem-syntax/59623/1 "2020-12-08T18:00:30Z")

</div>

Hi Everyone,  
I have a question that might be really easy for most of you. My application is generating a PDF report that I am saving to a folder named “Facturas” on the desktop. What I want to do is save it in the same directory as my application which already has a folder called “facturas”, I tried to do this but get an error  
 ![image](https://forum.xojo.com/uploads/default/original/2X/6/600d207cfd8c5f20a6e2046edef0b7c0aaeb1a63.png)  
I tried to read the documentation for FolderItem and I thought I did the same thing but there is something that I am missing.  
Thank You

---

<div class="post-metadata">

**Author:** ![MarkusR](https://forum.xojo.com/user_avatar/forum.xojo.com/markusr/32/685_2.png) [@MarkusR](https://forum.xojo.com/u/MarkusR)\
**Post date:** [December 8, 2020, 6:15pm UTC](https://forum.xojo.com/t/folderitem-syntax/59623/2 "2020-12-08T18:15:56Z")

</div>

i think you need the new word and this pathmode  
[Constructor(path as String, pathMode as FolderItem.PathModes, followAlias as Boolean = true)](https://documentation.xojo.com/api/files/folderitem.html.Constructor(path_as_String,_pathMode_as_FolderItem.PathModes,_followAlias_as_Boolean_%3D_true))

example how i create a not existing folder

```
var path as FolderItem = SpecialFolder.Desktop.Child("Folder")
if path.Exists = False then path.CreateFolder
var file as FolderItem= path.Child("file.pdf")
```

---

<div class="post-metadata">

**Author:** ![Allen\_Arissa](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@Allen\_Arissa](https://forum.xojo.com/u/Allen_Arissa)\
**Post date:** [December 8, 2020, 6:50pm UTC](https://forum.xojo.com/t/folderitem-syntax/59623/3 "2020-12-08T18:50:57Z")

</div>

Thank you Markus,  
You pointed me to the right direction. I ended up doing this and it works  
 ![image](https://forum.xojo.com/uploads/default/original/2X/3/3f52ad46c9954e5ac4d84fe4e1f7e42e3c103209.png)

---

<div class="post-metadata">

**Author:** ![Jeannot\_Muller](https://forum.xojo.com/user_avatar/forum.xojo.com/jeannot_muller/32/13359_2.png) [@Jeannot\_Muller](https://forum.xojo.com/u/Jeannot_Muller)\
**Post date:** [December 8, 2020, 7:00pm UTC](https://forum.xojo.com/t/folderitem-syntax/59623/4 "2020-12-08T19:00:48Z")

</div>

And no worries. I remember when I started with Xojo over a decade ago. This FolderItem thing made me struggle the most. These days I can’t remember why, but it took me a while to understand as a beginner, probably because I was always in a rush when in need of it.

I remember that it helped me to take one day an hour or two and build an empty project and trying out all options of Folderitem and to debug it on all platforms and analysing what happened.

---

<div class="post-metadata">

**Author:** ![Allen\_Arissa](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@Allen\_Arissa](https://forum.xojo.com/u/Allen_Arissa)\
**Post date:** [December 8, 2020, 7:13pm UTC](https://forum.xojo.com/t/folderitem-syntax/59623/5 "2020-12-08T19:13:28Z")

</div>

Good idea Jeannot,  
I think I will do the same thing. But I am beginning to understand how it works.

---

<div class="post-metadata">

**Author:** ![Tim\_Hare](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_hare/32/176_2.png) [@Tim\_Hare](https://forum.xojo.com/u/Tim_Hare)\
**Post date:** [December 8, 2020, 10:53pm UTC](https://forum.xojo.com/t/folderitem-syntax/59623/6 "2020-12-08T22:53:17Z")

</div>

Note that

```auto
var path as new FolderItem("")
path = path.child("facturas")

```

is the same as

```auto
var path as new FolderItem("facturas")

```

---

<div class="post-metadata">

**Author:** ![Allen\_Arissa](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@Allen\_Arissa](https://forum.xojo.com/u/Allen_Arissa)\
**Post date:** [December 9, 2020, 12:32pm UTC](https://forum.xojo.com/t/folderitem-syntax/59623/7 "2020-12-09T12:32:45Z")

</div>

Thanks Tim,  
Good to know.
