LINUX.ORG.RU

какие имена файлов допустимы?


0

0

Доброго всем!
Скажите пожалуйста, в каком документе можно прочитать о формате допустимых имён файлов в Linux? (делаю fuse-файловую систему на лиспе).
Например, я экспериментально выяснил, что имя файла может содержать звёздочку.
Спасибо за ответы, код, безусловно, будет открыт :)

★★★★★
Ответ на: комментарий от den73

Filename: a name consisting of 1 to {NAME_MAX} bytes used to name a file.
    The characters composing the name may be selected from the set of
    all character values excluding the slash character and the null byte.
    The filenames dot and dot-dot have special meaning.
    A filename is sometimes referred to as a "pathname component".

http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html

alex_custov ★★★★★
()
Ответ на: комментарий от den73

>А длина какая может быть?

255 кажись

только там есть фишка: фс сама по себе тоже может накладывать ограничения.

generatorglukoff ★★
()
Ответ на: комментарий от anonymous

а еще можно глянуть linux kernel, например linux-2.6.28/fs/namei.c

/*
 * Name resolution.
 * This is the basic name resolution function, turning a pathname into
 * the final dentry. We expect 'base' to be positive and a directory.
 *
 * Returns 0 and nd will have valid dentry and mnt on success.
 * Returns error and drops reference to input namei data on failure.
 */
static int __link_path_walk(const char *name, struct nameidata *nd)

а макс. длина пути и имени файла у каждой fs своя:
linux-2.6.28/include/linux/nfs.h
#define NFS_MAXPATHLEN  1024
#define NFS_MAXNAMLEN   255

linux-2.6.28/include/linux/jffs2.h
#define JFFS2_MAX_NAME_LEN 254

linux-2.6.28/include/linux/ext2_fs.h
#define EXT2_NAME_LEN 255

linux-2.6.28/include/linux/reiserfs_fs.h
#define REISERFS_MAX_NAME(block_size) 255

ну и т.д.

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.