Feature request: Export clean folder

Hi,

When exporting the site to a folder if there is some file unsused (from past export) it’s not deleted. It’s very important to add an option to clean export folder before do the new export because when working on some plartforms like embedded devices all folder is converted to hex file to be compiled and the converter gets all the files in this folder, if the folder is not clean we are embedding some unused files that can occupy lot of bytes, very important on this small devices.

Another solution is to add a new script option to execute before the export, actually the script is executed after.

Thanks

1 Like

I find it much better to utilize that situation to make a backup of the site in the folder. By creating a backup folder for it and moving all the files into it that BSS will replace (and any others) this takes care of backing up in case of an issue so I can put it right back if needed, and cleans out the folder at the same time.

Personally I don’t see a need for this option myself. I think it would cause more issues than what it will help with all the people that “are not very website savvy, or computer savvy for that matter”, and we’d see a billion posts that so many files have been lost due to … I’m sure you get the picture.

Those few seconds it takes to manually clean out your file gives you the ability to make your quick backup right away too. Or if you can get a script to do it that would probably be the better option.

It is very annoying to have to manually delete the folder continuously, it may be that deleting it automatically is a problem, so a selector should be added to select whether or not you want the folder to be deleted before exporting, that will not cause any problem and for cases like mine is very beneficial. adding another script that runs before and not after the export would also be a solution

I don’t like the idea of any software automatically deleting files from my system. That’s one of the main reasons why computers have an operating system - for managing the contents of your storage/folders.

If you use a program like Filezilla to upload your website files, it’s very easy to delete the contents of your BSS export folder from within Filezilla. Just highlight > right click > delete.

2 Likes

Automatic deleting of you EXPORT folder, not your hard disk…
Not all devices hace FTP os SSH for uploading, as I said when working with embedded devices (like the configuration webpage of the router or any other device) the wabsite is embedded in the resources, in my case Eclipse gets the contents of the export folder and then fits into the code.

The best option is to add a “run before” script and let the user choice if want to do something, it’s a great idea and very helpful.

Thanks

As a general rule, software should never delete any files, or the contents of any folder, regardless of where the data resides. Overwriting of the files when they have the same name is expected behavior.

Files generated like the files on export folder can be deleted withoout ay problem, is a common practice like a compiler do with the /obj /bin… folders because this files are generated by the program and user shouldn’t place any other file here… Overwriting files when threre are old unused files in the folder not solves the problem because you have files in this folder that should not exist and this not necessary files causes problems.

Can’t spend more time talking about this, if the developer whants to add the “before script” or “clean before export” it will be useful for many users and is not a problem for the rest.

1 Like

you could use a script to delete the old files.

Something like:

@ECHO  OFF
cd %1
forfiles -p %1 -s -m *.* -d -1 -c "cmd /c del @path"

This is a windows batch script that will delete html files older than 1 day, you would probably have to use something like powershell to do a shorter time frame.

Something like:

Get-ChildItem -Path %1 -Recurse -Force | Where-Object {$_.LastWriteTime -lt (Get-Date).AddSeconds(-60)} | Remove-Item -Force -Recurse

PS. I take no responsibility if it deletes any wanted files

hi, the problem is not to write an script, the problem is the software, don’t have any option to run it before de export

Thank you for the suggestion! Unfortunately I think that a feature to clean the export folder is a dangerous idea. I can imagine many people will turn it on without understanding what it does, and then lose important files.

I also think that an option for running scripts before the export is too specific – the only use case would be to clean up old files in the export destination. If this is what you need to do, you can do something like richards suggested, and delete files that are older than a couple of minutes in your regular export script.

1 Like

hi,

ok I will do this, clean old files.

Thanks