Unique photo designator - GUID and serial number

Some time ago I wrote a plan management system for a council that I am working on, which allows me to store all old and new plans in digital format with information related to an access database (I did not know the MS SQL server at that time).

Each plan has a unique plan identifier, which is simply an incremental int (primary key), a title, and an image path. At that time, I just used the GUID as the name of the image to ensure uniqueness, and I'm just wondering if this was a bad move.

All snapshots are moved to the same central folder during import, so the names must be unqiue.

I thought that maybe I should just use auto incrementing int as the file name, and not a long and not very user-friendly / debug GUID.

What would you do?

EDIT: Sorry, forgot to mention that the files are really known only to the software, after importing the program creates a shortcut for the file in the folder into which it was imported, with the name of the source file. I made it so that people could still get into the document without executing the program, and therefore the old hyperlinks worked, etc.

+3
source share
8 answers

, , . / , GUID.

"" , .

+6

, , . , .

+2

" ", GUID pk .

+2

GUID Access . :

http://trigeminal.com/usenet/usenet011.asp?1033

Access, , .

, Autonumber , , - . , - Autonumber ( ).

, NO - GUID , , .

+2

; , // ? "" , ?

, , ", " - GUID .

+1

, GUID .

, GUID ,

extension = getFileExtension();
filename = getFriendlyName();
int i = 1;
while (File.Exists(filename)) {
    filename = getFriendlyName() + (i++);
}
writeFile(filename+extension);

, , (A \, B\ ..)

+1

/? , GUID .

+1

GUID , . , , . , GUID .

, . , GUID , , , , GUID , , .

GUID, . . , ... , , . 32- - . 64- .

Choosing between a GUID or an integer to make the name more user friendly? What for? If you want convenient names, let the user provide them ...

+1
source

Source: https://habr.com/ru/post/1716639/


All Articles