FCStd1 files

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
leoheck
Veteran
Posts: 1225
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

FCStd1 files

Post by leoheck »

Hello, all.

I would like to say that FCStd1 files annoy me so much. I have hundreds of them spread on my folders.
Is it possible to change the backup files naming to use

Code: Select all

.myfile.FCStd
so they are hidden by default instead of using

Code: Select all

myfile.FCAStd1
extension? How can I do that? I couldn't find such a configuration. Thank you.
chrisb
Veteran
Posts: 54210
Joined: Tue Mar 17, 2015 9:14 am

Re: FCStd1 files

Post by chrisb »

There was some effort in configuring the backup names, but I'm afraid isn't finished (yet).

I guess you are talking about linux, so you can move or remove them all together with something like

remove:

Code: Select all

find ~/ -name "*.FCStd1" -print0 | xargs -0 rm

Code: Select all

find ~/ -name "*.FCStd1" -exec mv {} pathToSomeBackupFolder \;
Please note that the move command overwrites files with identical names.

Edit: corrected after post below.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: FCStd1 files

Post by openBrain »

chrisb wrote: Sun Jun 30, 2019 9:28 pm I guess you are talking about linux, so you can move or remove them all together with something like
Let me propose some improvements :)

Code: Select all

find ~/ -name "*.FCStd1" -print0 | xargs -0 rm

Code: Select all

find ~/ -name "*.FCStd1" -exec mv {} pathToSomeBackupFolder \;
chrisb
Veteran
Posts: 54210
Joined: Tue Mar 17, 2015 9:14 am

Re: FCStd1 files

Post by chrisb »

Thanks! I forgot the quoted ';' and since I never use blanks in my filenames I forgot the print0 too :oops: . Glad I said "...something like..."
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: FCStd1 files

Post by TheMarkster »

Windows users who want to clean out their old FCStd1 files:

It goes without saying, but I'll say it anyway, be careful, really really careful with del and wildcards (* and ?) as misuse can lead to deleting the wrong files, and del is not recycle bin aware, so no way to recover, at least not easily. Backup your files first before doing any of this. Then if you are satisfied with the outcome you can remove the backups. Don't blame me if you fail to do this.

From command prompt (probably need administrative privileges) :

Code: Select all

del *.FCStd1 /S
Note: the /S parameter means to do this for the current folder and also for all subfolders.

Or if you want to rename them so they can be opened in FreeCAD:

Code: Select all

ren *.FCStd1 *.FCStd1.FCStd
But this only works for the current directory as ren has no support for /S parameter.

If you want to hide all the .FCStd1 files:

Code: Select all

attrib +h *.FCStd1 /S
If you'd like to move all FCStd1 files in all subfolders to a backup folder:

Code: Select all

mkdir ..\freecad_backups
xcopy *.FCStd1 ..\freecad_backups /s
del *.FCStd1 /s
First line creates the backup folder as a sibling to the current parent directory. You would need write permission in that folder.
Second line copys all FCStd1 files in current and all subfolders to the backup folder
Third line deletes all of the FCStd1 files in current and all subfolders.

You don't really need the first line above because xcopy will create the directory for you if it doesn't already exist, but by doing it manually in the first line you will get an error message if you don't have administrative authority before trying the xcopy in the next line.

The folder heirarchy is kept in the backup folder. If you want to trash the backup folder and all of its contents probably the best to do that is through the GUI in Explorer. There was an old command call deltree that could do it from the command line, but that seems to have been removed.

If you want to mark your FCStd files as read only:

Code: Select all

attrib +r *.FCStd /s
That would protect them from accidental deletion. Then to remove the readonly attribute:

Code: Select all

attrib -r *.FCStd /s
If you changed the preferences to have more than 1 backup file at a time you would also have some *.FCStd2 files, etc. In that case to remove those you should first mark the regular .FCStd files readonly, then proceed to delete the backups.

Make certain the attrib +r bit worked before proceeding. If it doesn't the second line below will delete all of your FCStd files!

Code: Select all

attrib +r *.FCStd /s
del *.FCStd? /s
attrib -r *.FCStd
You will get access denied messages for the write-protected *.FCStd files, which won't be deleted, but all the FCStd1 FCStd2, etc. files will be deleted. The "?" only matches a single character, so if you had more than 9 backups per file it won't catch some of them. Can use del *.FCStd* instead in that case.

You can see the attributes of the files:

Code: Select all

attrib *.*
This should produce a directory listing with R next to those files that are marked readonly.
chrisb
Veteran
Posts: 54210
Joined: Tue Mar 17, 2015 9:14 am

Re: FCStd1 files

Post by chrisb »

On windows you can search for these files in the file explorer. They will be listed in a window and you can delete them from there. That will put them in the recoverable bin.
I guess there is something similar for Ubuntu and other Linuxes?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: FCStd1 files

Post by TheMarkster »

chrisb wrote: Mon Jul 01, 2019 12:36 am On windows you can search for these files in the file explorer. They will be listed in a window and you can delete them from there. That will put them in the recoverable bin.
I guess there is something similar for Ubuntu and other Linuxes?
I think with PCManFM file manager in ubuntu something similar can be done.

If you have FCStd1, FCStd2, FCStd3, etc. filenames a wildcard search will still bring up the original FCStd files, so I think the method I showed of first write protecting the .FCStd files, then deleting the others, then removing the write protection will still be a preferred option for some. For example *.FCStd? brings up also the .FCStd files.

Another option if you have git installed you can open a git bash in that folder and use linux terminal commands.
leoheck
Veteran
Posts: 1225
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Re: FCStd1 files

Post by leoheck »

Thanks, guys, you were awesome however I am good at the Linux and I know these commands.
I was really looking for a FreeCad configuration to do that.
Maybe someone can point me how to disable the backups, if possible since I never had to use them.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: FCStd1 files

Post by openBrain »

leoheck wrote: Tue Jul 02, 2019 2:32 am Maybe someone can point me how to disable the backups, if possible since I never had to use them.
Not sure but I'd bet that unchecking the 3 boxes below found in Preferences / General / Document will prevent backup files creation. ;)
fcstd1.png
fcstd1.png (14.26 KiB) Viewed 1510 times
User avatar
Forthman
Veteran
Posts: 2668
Joined: Fri Apr 27, 2018 11:23 am
Location: Tarn-et-Garonne (82)

Re: FCStd1 files

Post by Forthman »

uncheck the last only (maximum of backup files) ;)
I did it : autorecovery still ok, and goodbye FCstd1 files :mrgreen:
Post Reply