LoginSignup
0
0

More than 3 years have passed since last update.

cat/TYPE の代替としての StreamRelay.NET.exe (NTFS代替ストリーム)

Last updated at Posted at 2017-06-05

C#/.NET Framework のファイルストリームは、NTFS代替ストリームに対応していない。
という事で、VisualC++/CLR にて、代替ストリームを読み書きするストリームをプラグインとして、作った。


プラグイン

VisualC++/CLR には「AnyCPU」というコンパイルができないので、

  • Plugins\Win32\stdioFileC32.dll
  • Plugins\Win64\stdioFileC64.dll

が実体だ


cat/TYPE コマンドの代替(代替ストリーム)

通常のファイル読み書きと同じで、ストリームの実体(ソース)を「コンソール(-LocalPort=0 or -RemotePort=0)」にして

  • -LocalInputFileC
  • -RemoteInputFileC
  • -LocalOutputFileC
  • -RemoteOutputFileC

を指定する

C:\>echo Hello > a.txt:hehehe
C:\>dir a.txt
2017/06/05 15:56 0 a.txt
1 個のファイル 0 バイト
C:\>type a.txt
 
C:\>StreamRelay.NET.exe -LocalPort 0 -RemotePort 0 -LocalInputFileC a.txt:hehehe
Hello


cat/TYPE の代替としての StreamRelay.NET.exe

cat/TYPE の代替としての StreamRelay.NET.exe


目次へ戻る

目次というか最初の一歩

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0