inode is already unique by the filesystem.

This is not true. Under many unix filesystems the inode (Index NODE) number is unique within a partition.

This is important because multiple filesystems (each on it's own partition) can be mounted by a unix system at the same time at different directories. This means your web server's /usr and /var can both have inode number 4615 for one file below it's mount point.

Some filesystems do not use inodes. Eg FAT and FAT-32. When Linux (used beause I'm familiar with it) mounts a fat32 filesystem it assigns inode numbers as the directories and files are accessed.

This means if you unmount and remount the filesystem you are quite likely to get different inode numbers assigned to the same file. UPDATE: Just to be clear this referrers to filesystems that do not use inodes.

Personally I would be tempted to use a database "sequence" since I would be storing account info, etc in a database anyway. In MySQL you can use an "auto increment" field.

If you are not using a database you can still keep track of a sequence number in a file but you have to be sure your scripts lock the file so you never reuse a sequence number.

In reply to Re: letting a browser client select a file to download by inode by superfrink
in thread letting a browser client select a file to download by inode by leocharre

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.