Creating a new file

I should know this but I just have a problem with it. And can’t figure it out from the docs.

I want to create a text file, without user intervention and put it into a folder, which I already have a Folderitem for.

[code] Dim fld As FolderItem
fld = App.ExecutableFile.Parent.Child(“Save_Files”)
If Not fld.Exists Then
fld.CreateAsFolder
/// permission
End If
fld.Permissions=&o772

Dim f As New FolderItem
f=fld.Child(Name)

Try[/code]

I get an exception on the last line. What do I need to do?

Also what is the Permissions for a everybody to write (like a dropbox)?

Permissions for everyone for everything is &o777.

you don’T need the new here in “Dim f As New FolderItem”

you get exception on try? Sounds like more is missing like a catch and “end try”?

Fld.createAsFolder is probably failing since you are not allowed to create new items in the app package at runtime. Since you don’t have any error checks after the attempt to create the new folder, I’m guessing that’s why you get the exception

Error on NEXT TO LAST line, not the try. Getting an UnsupportedFormatException.

My stupid error.

System did not like the file name: “Crash-”+d.SQLDateTime+".txt"

The SQLDateTime has “:” char. which is not good for file names.

Thanks for the try.

Good you found it. Next time please tell us directly what exception you mean. Thanks.