main.c (15.08.10)
Creates exFAT file system.
- Copyright (C) 2011, 2012 Andrew Nayenko
+ Copyright (C) 2011-2013 Andrew Nayenko
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
return get_sector_size() << get_spc_bits();
}
-static off_t setup_volume_size(struct exfat_dev* dev)
-{
- off_t size = exfat_seek(dev, 0, SEEK_END);
- if (size == (off_t) -1)
- exfat_error("failed to get volume size");
- return size;
-}
-
static int setup_spc_bits(int sector_bits, int user_defined, off_t volume_size)
{
int i;
{
param.sector_bits = sector_bits;
param.first_sector = first_sector;
-
- param.volume_size = setup_volume_size(dev);
- if (param.volume_size == (off_t) -1)
- return 1;
+ param.volume_size = exfat_get_size(dev);
param.spc_bits = setup_spc_bits(sector_bits, spc_bits, param.volume_size);
if (param.spc_bits == -1)
}
else if (strcmp(*pp, "-v") == 0)
{
- puts("Copyright (C) 2011, 2012 Andrew Nayenko");
+ puts("Copyright (C) 2011-2013 Andrew Nayenko");
return 0;
}
else if (spec == NULL)
if (spec == NULL)
usage(argv[0]);
- dev = exfat_open(spec, 0);
+ dev = exfat_open(spec, EXFAT_MODE_RW);
if (dev == NULL)
return 1;
if (setup(dev, 9, spc_bits, volume_label, volume_serial,