Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- printf("this is a test\n");
- # http://www.tutorialspoint.com/perl/perl_files.htm
- #rename("one", "two"); I tested a basic rename would work and it did.
- # This chunk creates a long file name. The concatenated string is
- # a short hand form, to save typing. The $b string variable, holds
- # a less than ten character string, so you can find out exactly how
- # many characters the file system will take. The "open" command tries
- # to create a file, and if the create operation fails, the program
- # exits.
- $a = "0123456789";
- $b = $a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a ;
- $b = $b . "0.txt" ;
- open(OUT, ">>$b") || die("Cannot create file");
- close(OUT);
- # On my Win2K virtualpc test OS, I could get a total 259 character
- # path/filename. Same on Win10 (F:\259... Length of full file path is 259)
- # This prints out the filename. I'm working relative to the
- # current working directory, so I glue the working directory name
- # to the filename I'm using.
- use Cwd;
- $c = getcwd ;
- printf("%s/%s\n", $c , $b );
- $c = $c . "/" . $b ;
- printf("Length of full file path is %d\n", length $c );
- # When the file can no longer be erased, I uncomment this
- # line and it renames the long filename, back to a ten character
- # file name, for easy deleting in Explorer. If I run the script
- # as is, the file name ends up as "0123456789". Place the # in
- # front of this line, to see the 259 character filename in the folder.
- #rename( $b , $a );
- exit(0);
Add Comment
Please, Sign In to add comment