@@ -27,7 +27,7 @@ import (
2727 "io"
2828 "os"
2929 "os/signal"
30- "path"
30+ "path/filepath "
3131 "runtime"
3232 "strings"
3333 "syscall"
@@ -251,7 +251,7 @@ func ImportHistory(chain *core.BlockChain, db ethdb.Database, dir string, networ
251251 if err != nil {
252252 return fmt .Errorf ("error reading %s: %w" , dir , err )
253253 }
254- checksums , err := readList (path .Join (dir , "checksums.txt" ))
254+ checksums , err := readList (filepath .Join (dir , "checksums.txt" ))
255255 if err != nil {
256256 return fmt .Errorf ("unable to read checksums.txt: %w" , err )
257257 }
@@ -268,7 +268,7 @@ func ImportHistory(chain *core.BlockChain, db ethdb.Database, dir string, networ
268268 )
269269 for i , filename := range entries {
270270 err := func () error {
271- f , err := os .Open (path .Join (dir , filename ))
271+ f , err := os .Open (filepath .Join (dir , filename ))
272272 if err != nil {
273273 return fmt .Errorf ("unable to open era: %w" , err )
274274 }
@@ -425,7 +425,7 @@ func ExportHistory(bc *core.BlockChain, dir string, first, last, step uint64) er
425425 )
426426 for i := first ; i <= last ; i += step {
427427 err := func () error {
428- filename := path .Join (dir , era .Filename (network , int (i / step ), common.Hash {}))
428+ filename := filepath .Join (dir , era .Filename (network , int (i / step ), common.Hash {}))
429429 f , err := os .Create (filename )
430430 if err != nil {
431431 return fmt .Errorf ("could not create era file: %w" , err )
@@ -458,7 +458,7 @@ func ExportHistory(bc *core.BlockChain, dir string, first, last, step uint64) er
458458 return fmt .Errorf ("export failed to finalize %d: %w" , step / i , err )
459459 }
460460 // Set correct filename with root.
461- os .Rename (filename , path .Join (dir , era .Filename (network , int (i / step ), root )))
461+ os .Rename (filename , filepath .Join (dir , era .Filename (network , int (i / step ), root )))
462462
463463 // Compute checksum of entire Era1.
464464 if _ , err := f .Seek (0 , io .SeekStart ); err != nil {
@@ -481,7 +481,7 @@ func ExportHistory(bc *core.BlockChain, dir string, first, last, step uint64) er
481481 }
482482 }
483483
484- os .WriteFile (path .Join (dir , "checksums.txt" ), []byte (strings .Join (checksums , "\n " )), os .ModePerm )
484+ os .WriteFile (filepath .Join (dir , "checksums.txt" ), []byte (strings .Join (checksums , "\n " )), os .ModePerm )
485485
486486 log .Info ("Exported blockchain to" , "dir" , dir )
487487
0 commit comments