Windows [SOLVED] File Opening not working

Dan1

Member
Hey everyone,

So I've disabled the file sandbox but when I try
Code:
file_text_open_read("C:\Users\<USER>\Desktop\...")
- nothing happens, just an error saying the file isn't open for reading

But then, when I do this...
Code:
file_text_open_read(get_open_filename(...))
- it opens the file no problem

Does anyone know why this might be happening?
Thanks!
 
S

Sam (Deleted User)

Guest
Did you try using environment_get_variable() to get your current user folder and appending the desktop folder and filename to that string?

It might be a bug with turning off the sandbox. There's good chance there are some functions they forgot to add when turning off the sandbox.
 
L

Lonewolff

Guest
So I've disabled the file sandbox but when I try
Code:
file_text_open_read("C:\Users\<USER>\Desktop\...")
- nothing happens, just an error saying the file isn't open for reading

You need to either do this (or this). Which ever style you prefer.

Code:
file_text_open_read("C:\\Users\\<USER>\\Desktop\\...")
file_text_open_read("C:/Users/<USER>/Desktop/...")

\ is known as an 'escape' character.
 
S

Sam (Deleted User)

Guest
I'm surprised I missed that - he can also do what he currently is doing but with @'c:\path\to\file.txt'
 
Top