The Samba-Bugzilla – Attachment 5677 Details for
Bug 7399
SMB2: QUERY_DIRECTORY is returning invalid values.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Linux code to create X random names.
mkbigvardir.c (text/plain), 730 bytes, created by
Jeremy Allison
on 2010-04-30 13:32:43 UTC
(
hide
)
Description:
Linux code to create X random names.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2010-04-30 13:32:43 UTC
Size:
730 bytes
patch
obsolete
>#include <stdio.h> >#include <unistd.h> >#include <malloc.h> >#include <stdlib.h> >#include <string.h> >#include <sys/types.h> >#include <sys/stat.h> >#include <fcntl.h> > >char filename[300]; >char str[300]; > >char *random_str(int len) >{ > int i; > for (i = 0; i < len; i++) { > str[i] = 0x61 + (random() % 26); > } > str[i] = '\0'; > return str; >} > >int main(int argc, const char **argv) >{ > int i, count; > > if (argc != 3) { > fprintf(stderr, "Usage: %s <count> <seed>\n", > argv[0]); > return 1; > } > count = atoi(argv[1]); > srandom(atoi(argv[2])); > > strcpy(filename, "file."); > > for (i = 0; i < count; i++) { > int fd; > strcpy(&filename[5], random_str((i % 200) + 1)); > fd = open(filename, O_CREAT|O_EXCL, 0666); > close(fd); > } > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 7399
:
5671
|
5673
|
5676
| 5677 |
5678
|
5707