Difference between revisions of "ISSession:FileRedirect (Command)"
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
+ | == Operation == | ||
+ | FileRedirect works by performing a simple text replacement of the path+filename the application is attempting to open, with your provided snippet. You may replace all or part of the path. Slashes should be forward slashes ("/"), and will be normalized prior to replacement. Matching is case-insensitive. | ||
+ | |||
+ | FileRedirect is safe to use during PreStartup or Startup, but generally makes the most sense during PreStartup. | ||
+ | |||
== Syntax == | == Syntax == | ||
{{CMD-DR|FileRedirect|Advanced|Intermediate|Intermediate|Advanced}} | {{CMD-DR|FileRedirect|Advanced|Intermediate|Intermediate|Advanced}} | ||
FileRedirect <-list|-remove <original filename>|<original filename> [new filename]> | FileRedirect <-list|-remove <original filename>|<original filename> [new filename]> | ||
− | == | + | |
− | + | == Forms == | |
− | + | *FileRedirect -list - lists all redirected files | |
+ | *FileRedirect -remove <original filename> - removes a file redirection | ||
+ | *FileRedirect <original filename> [new filename] - redirects from original file to new file | ||
== Examples == | == Examples == | ||
− | FileRedirect -list | + | ===List redirected files=== |
− | FileRedirect User.Dat User-John.dat | + | *FileRedirect -list |
− | FileRedirect -remove User.Dat | + | ;Output |
+ | Inner Space redirected files | ||
+ | ------------------------- | ||
+ | 'bob.dat' => 'tim.dat' | ||
+ | |||
+ | ===Redirect from one file to another=== | ||
+ | *FileRedirect User.Dat User-John.dat | ||
+ | ;Output | ||
+ | File 'User.Dat' redirected to 'User-John.dat' | ||
+ | |||
+ | ===Redirect all directory access === | ||
+ | Assuming the application is opening files under C:/users/username/AppData/Local/PRODUCER\GAME/d_program files_producer_game/, and we want to append some value to this | ||
+ | *FileRedirect "AppData/Local/PRODUCER/GAME/d_program files_producer_game/" "AppData/Local/PRODUCER/GAME/d_program files_producer_game_${CharName}" | ||
+ | ;Output (assuming ${CharName} is "foo" | ||
+ | File 'AppData/Local/PRODUCER/GAME/d_program files_producer_game/' redirected to 'AppData/Local/PRODUCER/GAME/d_program files_producer_game_foo' | ||
+ | |||
+ | ===Redirect across drives === | ||
+ | Assuming the application is opening files under C:/temp/foo, '''and is accessing the file via its absolute path''', and we want to move it to a different drive | ||
+ | *FileRedirect "C:/temp/foo/" "D:/temp/foo/" | ||
+ | |||
+ | ===Remove a FileRedirect=== | ||
+ | *FileRedirect -remove User.Dat | ||
+ | ;Output | ||
+ | File 'User.Dat' redirection removed | ||
+ | |||
== See Also == | == See Also == | ||
*[[LavishScript:Commands|LavishScript Commands]] | *[[LavishScript:Commands|LavishScript Commands]] | ||
Line 15: | Line 46: | ||
{{Command-Stub}} | {{Command-Stub}} | ||
+ | [[Category:Inner Space]] | ||
+ | [[Category:Inner Space Session]] | ||
+ | [[Category:Inner Space Session Commands]] |
Latest revision as of 22:15, 7 May 2013
Contents
Operation
FileRedirect works by performing a simple text replacement of the path+filename the application is attempting to open, with your provided snippet. You may replace all or part of the path. Slashes should be forward slashes ("/"), and will be normalized prior to replacement. Matching is case-insensitive.
FileRedirect is safe to use during PreStartup or Startup, but generally makes the most sense during PreStartup.
Syntax
FileRedirect | |
Usage | Advanced |
Level of Understanding | Intermediate |
Computer Savvy | Intermediate |
Logic | Advanced |
FileRedirect <-list|-remove <original filename>|<original filename> [new filename]>
Forms
- FileRedirect -list - lists all redirected files
- FileRedirect -remove <original filename> - removes a file redirection
- FileRedirect <original filename> [new filename] - redirects from original file to new file
Examples
List redirected files
- FileRedirect -list
- Output
Inner Space redirected files ------------------------- 'bob.dat' => 'tim.dat'
Redirect from one file to another
- FileRedirect User.Dat User-John.dat
- Output
File 'User.Dat' redirected to 'User-John.dat'
Redirect all directory access
Assuming the application is opening files under C:/users/username/AppData/Local/PRODUCER\GAME/d_program files_producer_game/, and we want to append some value to this
- FileRedirect "AppData/Local/PRODUCER/GAME/d_program files_producer_game/" "AppData/Local/PRODUCER/GAME/d_program files_producer_game_${CharName}"
- Output (assuming ${CharName} is "foo"
File 'AppData/Local/PRODUCER/GAME/d_program files_producer_game/' redirected to 'AppData/Local/PRODUCER/GAME/d_program files_producer_game_foo'
Redirect across drives
Assuming the application is opening files under C:/temp/foo, and is accessing the file via its absolute path, and we want to move it to a different drive
- FileRedirect "C:/temp/foo/" "D:/temp/foo/"
Remove a FileRedirect
- FileRedirect -remove User.Dat
- Output
File 'User.Dat' redirection removed