file_check | R Documentation |
If longer than N characters (Windows filesystem max path length), try with md5 hashed filename
file_check(file, strict = FALSE)
file |
filename to check (may include a path) |
strict |
boolean indicating 'strict mode' for checking the filename, if TRUE; only allow alphanumeric, underscore and '-' |
note; in contrast to using a timestamp or substring+index, this solution yields stable filenames. Should never fail if provided path/dir is reasonable
## Not run:
x = c("C:/temp/file*.txt", "test=2", "test=2.abc",
paste0("c:/temp/",paste(rep("a",300),collapse=""),".txt"))
cbind(x, file_check(x))
## End(Not run)
## Not run:
file_check("C:/temp/") # error, trailing slashes not allowed
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.