## Rust, 60 bytes ##

    fn main(){let a=include_str!("a.");print!("{}",a.len()-1)}//

What's happening is the file is including itself as a string during compiletime, and getting the length of itself.

 When appended, the extra code is commented out, but still effects the length of the file.

Only works if the file name is 'a.'