[RELEASE] File Manager Device

He has coding help from the cat.

1 Like

The cat is a whiz on the keyboard


not sure how much help he really is though. :sunglasses:

2 Likes

I tried to use RM first, but I received an error message, so I tried the virtue of FileManager. It seems the append function in RM also failed if the file didn't already exist.

Just tried it. Works fine, Thanks!

3 Likes

Is it possible to clear out the fileContent attribute? During my testing I uploaded a large file, but I can't seem to find a way to zero-out the attribute now.

It used to auto delete after about a minute, I’ll take a look to see why it isn’t working now

Error reported, but it worked as expected.

1 Like

How do I append a carriage return in an append action on FileManager? I am trying to log some light levels through the day and I need a way to terminate each line as it is entered. In the built-in File Manager I can just enter a return on the parameter line, but in FileManager that return appears to be ignored. I tried the "\n" above, but it just puts that string in the parameter, unless I am doing it wrong. I prefer to use the File Manager device because I can specify the file I want to append to by adding a reference to a variable, such as LightLevelLog_%date%, which I cannot do with the built-in File Manager.

Used to be able to just hit the newline key, but that appears to be filtered out somehow. Will need to play with it some to see what makes sense to implement.

I wondered if I could append to a file using the Hex value 0D0AH, but I don't see an option to "append as Hex".

@thebearmay, something else I noticed. I thought I would try to solve the problem I mentioned above by copying the daily file (LightLevelLog.txt) to a new file every day with a different name. However, I noticed when I read the file it did not load into the fileContent attribute. you will recall from earlier that there is a huge amount of data in that attribute and I have been unable to get rid of it. I thought if I tried to load another file it would be overridden, but not so. The new daily file I created (LightLevelLog_2024-01-02) contained the data I was trying to get rid of rather than the data just read. Here is an image of the my rule:

Make sure you have the attribute enabled in the preferences. Also note that the attribute will clear itself in approximately 30 seconds (the browser may not display the fact that the attribute has cleared unless you refresh the page).

v0.2.9 will convert \n in a text file to newline characters for the Write File and Append File commands.

Have I set these correctly?

That's set correctly (may want to re-save the preferences if you've upgraded recently).

Thanks @thebearmay for your help with this. You have been very generous and patient with your time.

2 Likes

Is there any way to suppress the output to the system log?
I have all the log/debug options turned off in the preferences.
My main issue is having the entire contents of the file I'm writing is showing in the log.

1 Like

There are two, Debug logging and Command Response logging - make sure both are turned off.

1 Like

These are my settings. I have everything switched off. Unless there are settings elsewhere I don't know what else I can change. It's not the end of the world that it stops posting to the system log but it would be nice to have the option.

Found a debug line that didn't have the qualifier on it. Update your code to v0.2.10.

2 Likes

B.T.W. Amazing Driver. Incredibly useful. Thanks much!

2 Likes