Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Crossplatform dirSeparator is now used.

  • Loading branch information...
commit 34ec3e912d9125b02210720743ba0a0cded1f7bc 1 parent 99930d3
@m1kc authored
Showing with 3 additions and 10 deletions.
  1. +3 −10 sfn.d
View
13 sfn.d
@@ -27,6 +27,7 @@ import std.socketstream;
import std.getopt;
import std.conv;
import std.string;
+import std.path;
import core.thread;
import std.compiler;
@@ -179,16 +180,8 @@ void sendFiles()
{
stream.write(FILE);
File f = File(s, "r");
- version(Windows)
- {
- stream.writeString(f.name.split("\\")[$-1]);
- stream.writeString("\n");
- }
- else
- {
- stream.writeString(f.name.split("/")[$-1]);
- stream.writeString("\n");
- }
+ stream.writeString(f.name.split(dirSeparator)[$-1]);
+ stream.writeString("\n");
stream.write(f.size());
writeln(to!string(f.size()) ~ " bytes");
ulong size = f.size();
Please sign in to comment.
Something went wrong with that request. Please try again.